:root {
  --ink: #1a202c;
  --muted: #718096;
  --line: #e8edf2;
  --soft: #f7f9fb;
  --green: #22c55e;
  --green-dark: #16a34a;
  --green-soft: #eafbf0;
  --blue: #2f80ed;
  --blue-soft: #eaf4ff;
  --purple: #8b5cf6;
  --purple-soft: #f2edff;
  --orange: #f59e0b;
  --orange-soft: #fff6dd;
  --red: #ef4444;
  --red-soft: #fff0f0;
  --shadow: 0 18px 45px rgba(26, 32, 44, 0.08);
}

[hidden] {
  display: none !important;
}

.editorial-recommendations-panel {
  margin-top: 22px;
}

.recommendations-count {
  display: inline-flex;
  min-width: 34px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2ff;
  color: #4754c9;
  font-size: 13px;
  font-weight: 800;
}

.editorial-recommendations {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.editorial-recommendation {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 92px;
  padding: 16px;
  border: 1px solid #e9edf3;
  border-radius: 16px;
  background: #fff;
}

.editorial-recommendation::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3px;
  border-radius: 99px;
  background: #95a0af;
}

.editorial-recommendation.recommendation-high::before {
  background: #ef6464;
}

.editorial-recommendation.recommendation-medium::before {
  background: #e5a32f;
}

.editorial-recommendation.recommendation-low::before {
  background: #6273df;
}

.recommendation-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: #f4f6fb;
  color: #5664cf;
  font-size: 17px;
}

.editorial-recommendation > div {
  min-width: 0;
}

.editorial-recommendation b {
  display: block;
  margin-bottom: 4px;
  color: #202635;
  font-size: 14px;
}

.editorial-recommendation p {
  margin: 0;
  color: #758092;
  font-size: 12px;
  line-height: 1.45;
}

.channel-strategy-editor {
  display: grid;
  gap: 18px;
  margin: 22px 0;
  padding: 20px;
  border: 1px solid #e2e6f5;
  border-radius: 18px;
  background: linear-gradient(145deg, #fafbff, #f5f6fd);
}

.channel-comments-editor {
  display: grid;
  gap: 16px;
  margin: 0 0 14px;
  border: 1px solid #dcefe3;
  border-radius: 18px;
  padding: 20px;
  background: linear-gradient(145deg, #fbfefc, #f3fbf6);
}

.channel-auto-editor {
  display: grid;
  gap: 16px;
  border: 1px solid #d7ecdf;
  border-radius: 16px;
  padding: 17px;
  background: linear-gradient(145deg, #fbfffc, #f1fbf5);
}

.channel-auto-editor .channel-comments-toggle {
  margin: 0;
  background: rgba(255, 255, 255, 0.82);
}

.strategy-schedule-mode-row {
  grid-template-columns: 0.72fr 1.28fr;
}

.strategy-random-schedule-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.comments-editor-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.comments-editor-head .modal-icon {
  flex: 0 0 auto;
  margin: 0;
}

.comments-editor-head h3 {
  margin: 2px 0 5px;
  color: #202635;
  font-size: 18px;
}

.comments-editor-head p {
  margin: 0;
  color: #7a8393;
  font-size: 12px;
  line-height: 1.5;
}

.channel-comments-editor .channel-comments-rules {
  margin: 0;
}

.strategy-editor-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.strategy-editor-head .modal-icon {
  flex: 0 0 auto;
  margin: 0;
}

.modal-icon-purple {
  background: #eceaff;
  color: #6558cf;
}

.strategy-editor-head h3 {
  margin: 2px 0 5px;
  color: #202635;
  font-size: 18px;
}

.strategy-editor-head p {
  margin: 0;
  color: #7a8393;
  font-size: 12px;
  line-height: 1.5;
}

.strategy-schedule-row {
  grid-template-columns: 0.7fr 0.82fr 0.9fr;
}

.strategy-defaults {
  display: grid;
  gap: 9px;
}

.strategy-defaults-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4a5261;
  font-size: 12px;
  font-weight: 700;
}

.strategy-defaults > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.strategy-default-option,
.strategy-defaults label {
  position: relative;
}

.strategy-default-option {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.strategy-defaults label {
  cursor: pointer;
}

.strategy-defaults input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.strategy-defaults label span {
  display: inline-flex;
  gap: 7px;
  min-height: 38px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid #dfe4ec;
  border-radius: 11px;
  background: #fff;
  color: #667080;
  font-size: 12px;
  font-weight: 700;
  transition: 0.15s ease;
}

.strategy-defaults input:checked + span {
  border-color: #8c98e7;
  background: #eef0ff;
  color: #4c5bc0;
  box-shadow: 0 0 0 2px rgba(94, 108, 210, 0.08);
}

.strategy-field-label {
  display: flex;
  min-height: 19px;
  margin-bottom: 7px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #475467;
  font-size: 10px;
  font-weight: 750;
}

.strategy-help-button {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 0;
  padding: 0;
  color: #8591a5;
  background: transparent;
  font-size: 17px;
  cursor: pointer;
  transition: 0.16s ease;
}

.strategy-help-button:hover,
.strategy-help-button:focus-visible {
  outline: 0;
  color: #5968d0;
  transform: translateY(-1px);
}

.strategy-default-option > .strategy-help-button {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  font-size: 15px;
}

.strategy-help-content {
  display: grid;
  gap: 17px;
  color: #5f6979;
  font-size: 12px;
  line-height: 1.65;
}

.strategy-help-content section {
  display: grid;
  gap: 7px;
}

.strategy-help-content h3,
.strategy-help-content p,
.strategy-help-content ul {
  margin: 0;
}

.strategy-help-content h3 {
  color: #252c3a;
  font-size: 13px;
}

.strategy-help-content ul {
  display: grid;
  gap: 6px;
  padding-left: 20px;
}

.strategy-help-note {
  border: 1px solid #dfe3fb;
  border-radius: 12px;
  padding: 12px 14px;
  color: #4f5da4;
  background: #f5f6ff;
}

.strategy-help-modal {
  z-index: 120;
}

.channel-strategy-summary {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin: -3px 0 16px;
}

.channel-strategy-summary span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 9px;
  border-radius: 9px;
  background: #f4f6fb;
  color: #697486;
  font-size: 11px;
  font-weight: 700;
}

.channel-card-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.telegram-card-statuses,
.plan-status-stack {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.strategy-schedule-badge {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #efedff;
  color: #6257c7;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

@media (max-width: 960px) {
  .editorial-recommendations {
    grid-template-columns: 1fr;
  }

  .strategy-schedule-row,
  .strategy-schedule-mode-row,
  .strategy-random-schedule-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .editorial-recommendation {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .editorial-recommendation .text-button {
    grid-column: 2;
    justify-self: start;
  }

  .channel-strategy-editor {
    padding: 16px;
  }

  .channel-comments-editor {
    padding: 16px;
  }

  .channel-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--soft);
}

body {
  margin: 0;
  min-width: 320px;
}

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

button {
  cursor: pointer;
}

.admin-app-body {
  min-height: 100vh;
  background: #f6f8fa;
}

.admin-layout {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 286px;
  flex-direction: column;
  border-right: 1px solid #edf0f3;
  background: #fff;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  height: 98px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f0f2f4;
  padding: 0 30px;
}

.brand-mark {
  display: inline-grid;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.24);
}

.brand-copy,
.admin-login-brand > div {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong,
.admin-login-brand strong {
  font-size: 19px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.brand-copy span,
.admin-login-brand span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-close {
  display: none !important;
  margin-left: auto;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 25px 22px;
}

.sidebar-nav p {
  margin: 11px 12px 9px;
  color: #a0aec0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  color: #667085;
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  transition: 0.18s ease;
}

.nav-item:hover {
  color: var(--ink);
  background: #f6f8fa;
}

.nav-item.active {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.2);
}

.nav-item > i {
  width: 20px;
  font-size: 17px;
  text-align: center;
}

.nav-item em {
  min-width: 23px;
  margin-left: auto;
  border-radius: 999px;
  padding: 3px 7px;
  color: #718096;
  background: #edf1f4;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.nav-item.active em {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}

.sidebar-help {
  display: flex;
  gap: 12px;
  margin: 0 22px 18px;
  border-radius: 14px;
  padding: 15px;
  background: var(--green-soft);
}

.sidebar-help > i {
  color: var(--green-dark);
  font-size: 18px;
}

.sidebar-help div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sidebar-help b {
  font-size: 12px;
}

.sidebar-help span {
  color: #568269;
  font-size: 10px;
  line-height: 1.45;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  border-top: 1px solid #f0f2f4;
  padding: 19px 23px;
}

.profile-avatar,
.channel-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #1f2937;
  font-weight: 800;
}

.sidebar-profile > div {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.sidebar-profile b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
}

.sidebar-profile span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #718096;
  background: transparent;
  transition: 0.18s ease;
}

.icon-button:hover {
  color: var(--ink);
  background: #f1f4f6;
}

.admin-main {
  min-height: 100vh;
  margin-left: 286px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 98px;
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid #edf0f3;
  padding: 18px clamp(24px, 4vw, 52px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 190px;
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  color: var(--green-dark);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar-title h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.topbar-actions {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 10px;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 10px;
  padding: 0 17px;
  font-size: 12px;
  font-weight: 750;
  transition: 0.18s ease;
}

.primary-button {
  border: 1px solid var(--green);
  color: #fff;
  background: var(--green);
  box-shadow: 0 8px 17px rgba(34, 197, 94, 0.18);
}

.primary-button:hover {
  border-color: var(--green-dark);
  background: var(--green-dark);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.secondary-button {
  border: 1px solid #e3e8ed;
  color: #344054;
  background: #fff;
}

.secondary-button:hover {
  border-color: #cbd4dd;
  background: #f8fafb;
}

.danger-button {
  border: 1px solid var(--red);
  color: #fff;
  background: var(--red);
}

.danger-button:hover {
  border-color: #dc2626;
  background: #dc2626;
}

.text-button {
  min-height: 32px;
  border: 0;
  padding: 0;
  color: var(--green-dark);
  background: transparent;
}

.scheduler-pill {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 7px;
  border: 1px solid #e7ecef;
  border-radius: 11px;
  padding: 0 13px;
  background: #fff;
}

.scheduler-pill > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a0aec0;
}

.scheduler-pill.is-ok > span {
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.scheduler-pill.is-error > span {
  background: var(--red);
  box-shadow: 0 0 0 4px var(--red-soft);
}

.scheduler-pill.is-paused > span {
  background: #f59e0b;
  box-shadow: 0 0 0 4px var(--orange-soft);
}

.scheduler-pill b {
  font-size: 11px;
}

.scheduler-pill em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.mobile-menu {
  display: none;
}

.admin-content {
  margin: 0 auto;
  max-width: 1560px;
  padding: 32px clamp(24px, 4vw, 52px) 60px;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
  animation: view-in 0.24s ease;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0;
}

.stat-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 15px;
  border: 1px solid #edf0f3;
  border-radius: 16px;
  padding: 22px;
  background: #fff;
}

.stat-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  font-size: 19px;
}

.stat-green .stat-icon { color: var(--green-dark); background: var(--green-soft); }
.stat-purple .stat-icon { color: var(--purple); background: var(--purple-soft); }
.stat-blue .stat-icon { color: var(--blue); background: var(--blue-soft); }
.stat-orange .stat-icon { color: var(--orange); background: var(--orange-soft); }

.stat-card > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.stat-card small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.stat-card strong {
  margin: 4px 0 1px;
  font-size: 24px;
  line-height: 1;
}

.stat-card em {
  overflow: hidden;
  color: #a0aec0;
  font-size: 9px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-grid,
.scheduler-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 22px;
}

.panel {
  border: 1px solid #edf0f3;
  border-radius: 17px;
  padding: 24px;
  background: #fff;
}

.panel-head,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head h3,
.section-heading h2 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.panel-head h3 {
  font-size: 16px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  font-size: 26px;
}

.section-heading p {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.upcoming-list,
.channel-health-list {
  display: flex;
  flex-direction: column;
}

.upcoming-item,
.channel-health-item {
  display: grid;
  align-items: center;
  border-top: 1px solid #f0f2f4;
  padding: 15px 0;
}

.upcoming-item {
  grid-template-columns: 100px minmax(0, 1fr) auto;
  gap: 16px;
}

.upcoming-item:first-child,
.channel-health-item:first-child {
  border-top: 0;
}

.upcoming-time {
  display: flex;
  flex-direction: column;
}

.upcoming-time b {
  font-size: 12px;
}

.upcoming-time span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.upcoming-copy {
  min-width: 0;
}

.upcoming-copy b,
.channel-health-copy b {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upcoming-copy span,
.channel-health-copy span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.channel-chip {
  display: inline-flex;
  max-width: 150px;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  color: #1774b8;
  background: var(--blue-soft);
  font-size: 9px;
  font-weight: 750;
}

.channel-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-health-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
}

.channel-health-avatar,
.channel-card-avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2aabee, #1877b8);
  font-weight: 850;
}

.channel-health-avatar img,
.channel-card-avatar img,
.telegram-avatar img,
.moderation-post-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.channel-health-avatar {
  width: 37px;
  height: 37px;
  font-size: 12px;
}

.health-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a0aec0;
}

.health-dot.connected { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.health-dot.error { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed #dce3e8;
  border-radius: 14px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-state i {
  margin-bottom: 12px;
  color: #a9b5bf;
  font-size: 28px;
}

.empty-state b {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.empty-state p {
  max-width: 330px;
  margin: 5px auto 0;
  font-size: 10px;
  line-height: 1.5;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid #edf0f3;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.content-channel-filter {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  margin: -2px 0 14px;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
}

.content-channel-tab {
  display: inline-flex;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  border: 1px solid #e1e7ec;
  border-radius: 13px;
  padding: 6px 11px 6px 7px;
  color: #5e6b7e;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
  transition: 0.18s ease;
}

.content-channel-tab:hover {
  border-color: #a7dfb9;
  color: var(--ink);
  box-shadow: 0 5px 16px rgba(24, 43, 69, 0.06);
}

.content-channel-tab.active {
  border-color: var(--green);
  color: var(--green-dark);
  background: #f2fcf5;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.08);
}

.content-channel-tab-icon,
.content-channel-tab-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: #1f2937;
  font-size: 11px;
  font-weight: 850;
}

.content-channel-tab-icon {
  color: var(--green-dark);
  background: var(--green-soft);
}

.content-channel-tab-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.content-channel-tab > em {
  min-width: 23px;
  border-radius: 999px;
  padding: 4px 7px;
  color: #7f8a99;
  background: #f0f3f5;
  font-size: 10px;
  font-style: normal;
  text-align: center;
}

.content-channel-tab.active > em {
  color: var(--green-dark);
  background: #dff7e7;
}

.filter-bar > label {
  display: flex;
  min-width: 260px;
  flex: 1;
  align-items: center;
  gap: 9px;
  border: 1px solid #e4e9ed;
  border-radius: 9px;
  padding: 0 12px;
}

.filter-bar > label i {
  color: #a0aec0;
  font-size: 12px;
}

.filter-bar input,
.filter-bar select {
  height: 38px;
  border: 0;
  outline: 0;
  color: #344054;
  background: transparent;
  font-size: 11px;
}

.filter-bar > label input {
  width: 100%;
}

.filter-bar > select {
  min-width: 150px;
  border: 1px solid #e4e9ed;
  border-radius: 9px;
  padding: 0 10px;
  background: #fff;
}

.view-toggle {
  display: flex;
  gap: 3px;
  border: 1px solid #e4e9ed;
  border-radius: 9px;
  padding: 3px;
}

.view-toggle button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: #98a2b3;
  background: transparent;
}

.view-toggle button.active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.plan-board {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.plan-day {
  overflow: hidden;
  border: 1px solid #edf0f3;
  border-radius: 15px;
  background: #fff;
}

.plan-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #edf0f3;
  padding: 14px 18px;
  background: #fafbfc;
}

.plan-day-head b {
  font-size: 12px;
}

.plan-day-head span {
  color: var(--muted);
  font-size: 9px;
}

.plan-post {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) 160px 120px auto;
  gap: 16px;
  align-items: center;
  border-top: 1px solid #f1f3f5;
  padding: 16px 18px;
}

.plan-day-head + .plan-post {
  border-top: 0;
}

.plan-post-time {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 750;
}

.plan-post-time i {
  color: var(--green);
}

.plan-post-copy {
  min-width: 0;
}

.plan-post-copy b {
  display: block;
  overflow: hidden;
  margin-bottom: 4px;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-post-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.status-badge {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status-draft { color: #697586; background: #eef1f4; }
.status-scheduled { color: #7157d9; background: var(--purple-soft); }
.status-publishing { color: #b56d00; background: var(--orange-soft); }
.status-published,
.status-connected { color: #168541; background: var(--green-soft); }
.status-failed,
.status-error { color: #d73b3b; background: var(--red-soft); }
.status-paused { color: #b56d00; background: var(--orange-soft); }

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.row-actions button {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid #e8ecef;
  border-radius: 8px;
  color: #788596;
  background: #fff;
  font-size: 10px;
}

.row-actions button:hover {
  color: var(--ink);
  border-color: #ccd5dc;
}

.row-actions button.schedule:hover {
  color: #7157d9;
  border-color: #d8cffb;
  background: var(--purple-soft);
}

.row-actions button.delete:hover {
  color: var(--red);
  border-color: #ffd1d1;
  background: var(--red-soft);
}

.plan-board.table-mode .plan-day-head {
  display: none;
}

.plan-board.table-mode .plan-day {
  border-radius: 0;
  border-top: 0;
}

.plan-board.table-mode .plan-day:first-child {
  border-top: 1px solid #edf0f3;
  border-radius: 15px 15px 0 0;
}

.plan-board.table-mode .plan-day:last-child {
  border-radius: 0 0 15px 15px;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.channel-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #edf0f3;
  border-radius: 17px;
  padding: 22px;
  background: #fff;
  transition: 0.18s ease;
}

.channel-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.channel-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--green);
  content: "";
}

.channel-card.connection-error::before {
  background: var(--red);
}

.channel-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-card-avatar {
  width: 48px;
  height: 48px;
  font-size: 15px;
}

.channel-card-copy {
  min-width: 0;
  flex: 1;
}

.channel-card-copy b {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-card-copy span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: #2aabee;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-card-topic {
  margin-top: 17px;
  border-bottom: 1px solid #edf0f3;
  padding-bottom: 12px;
}

.channel-card-topic span {
  display: block;
  margin-bottom: 5px;
  color: #9aa5b3;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.channel-card-topic p {
  margin: 0;
  color: #4f5d70;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
}

.channel-card-tags {
  display: flex;
  margin: 10px 0 11px;
  flex-wrap: wrap;
  gap: 6px;
}

.channel-card-tone {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #7252bf;
  background: #f1ecff;
  font-size: 9px;
  font-weight: 750;
}

.channel-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  border-top: 1px solid #edf0f3;
  border-bottom: 1px solid #edf0f3;
  padding: 15px 0;
}

.channel-card-stats div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.channel-card-stats div + div {
  border-left: 1px solid #edf0f3;
  padding-left: 10px;
}

.channel-card-stats small {
  color: var(--muted);
  font-size: 8px;
}

.channel-card-stats b {
  margin-top: 4px;
  font-size: 13px;
}

.channel-card-state {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: space-between;
  margin: 13px 0;
}

.channel-card-state span:last-child {
  color: var(--muted);
  font-size: 8px;
}

.channel-error {
  overflow: hidden;
  margin: -3px 0 12px;
  border-radius: 8px;
  padding: 8px 10px;
  color: #b42318;
  background: var(--red-soft);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-card-actions {
  display: flex;
  gap: 7px;
}

.channel-card-actions button {
  min-height: 36px;
  flex: 1;
}

.channel-card-actions .icon-button {
  flex: 0 0 36px;
  min-height: 36px;
  border: 1px solid #e3e8ed;
  color: var(--red);
}

.channel-card-actions .channel-status-button {
  color: #7252bf;
}

.channel-card-actions .secondary-button {
  min-width: 0;
  padding: 0 10px;
}

.channel-sources-list {
  display: grid;
  max-height: 430px;
  overflow-y: auto;
  gap: 9px;
  margin: 4px 0 20px;
  padding-right: 3px;
}

.channel-source-option {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid #e5e9ee;
  border-radius: 13px;
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: 0.18s ease;
}

.channel-source-option:hover {
  border-color: #b7e8c9;
  background: #fbfffc;
}

.channel-source-option:has(input:checked) {
  border-color: #72d99a;
  background: #f3fcf6;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.08);
}

.channel-source-option > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.channel-source-check {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid #cfd7df;
  border-radius: 7px;
  color: transparent;
  background: #fff;
  font-size: 10px;
}

.channel-source-option input:checked + .channel-source-check {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.channel-source-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  color: #2563eb;
  background: var(--blue-soft);
  font-size: 15px;
}

.channel-source-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.channel-source-copy b {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-source-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-source-option > em {
  border-radius: 999px;
  padding: 4px 7px;
  color: #7a8695;
  background: #f0f3f5;
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

.channel-source-option > em.is-active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.channel-connect-guide {
  display: grid;
  margin: 16px 0 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.channel-connect-guide[hidden] {
  display: none;
}

.channel-connect-guide > div {
  display: flex;
  min-height: 84px;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid #e7ebef;
  border-radius: 11px;
  padding: 11px;
  background: #fafbfc;
}

.channel-connect-guide > div > span {
  display: grid;
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: #2aabee;
  font-size: 9px;
  font-weight: 850;
}

.channel-connect-guide p {
  margin: 1px 0 0;
  color: #657080;
  font-size: 9px;
  line-height: 1.45;
}

.channel-connect-guide b {
  color: var(--ink);
}

.channel-telegram-meta {
  display: flex;
  margin-top: 14px;
  align-items: center;
  gap: 10px;
  border-radius: 11px;
  padding: 11px 13px;
  color: #247fae;
  background: #eaf7fd;
}

.channel-telegram-meta[hidden] {
  display: none;
}

.channel-telegram-meta > i {
  font-size: 19px;
}

.channel-telegram-meta > div {
  display: grid;
  gap: 3px;
}

.channel-telegram-meta b {
  color: #245f7e;
  font-size: 9px;
}

.channel-telegram-meta span {
  color: #4c7e97;
  font-size: 8px;
}

.channels-grid > .empty-state {
  grid-column: 1 / -1;
}

.source-type-icon {
  display: grid;
  width: 39px;
  height: 39px;
  grid-row: 1 / span 2;
  place-items: center;
  border-radius: 11px;
}

.source-rss { color: #d97706; background: var(--orange-soft); }
.source-web { color: #2563eb; background: var(--blue-soft); }
.source-telegram { color: #168ac3; background: #e9f6fd; }
.source-x { color: #0f1419; background: #eef1f3; }
.source-search { color: #7c3aed; background: #f2ebff; }

.source-query {
  display: block;
  overflow: hidden;
  margin-top: 6px;
  color: #7252bf;
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.sources-grid > .empty-state {
  grid-column: 1 / -1;
}

.source-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  border: 1px solid #edf0f3;
  border-radius: 16px;
  padding: 20px;
  background: #fff;
}

.source-card-main {
  min-width: 0;
}

.source-card-main b {
  display: block;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card-main > a {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--blue);
  font-size: 12px;
  line-height: 1.45;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-keywords {
  display: flex;
  overflow: hidden;
  margin-top: 11px;
  gap: 5px;
}

.source-keywords span {
  overflow: hidden;
  max-width: 120px;
  border-radius: 999px;
  padding: 4px 7px;
  color: #697586;
  background: #f0f3f5;
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-card-meta {
  display: flex;
  grid-column: 2 / 4;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #edf0f3;
  padding-top: 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.source-card-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.source-card-meta .source-error {
  width: 100%;
  border-radius: 8px;
  padding: 8px;
  color: #b42318;
  background: var(--red-soft);
}

.source-card-actions {
  display: flex;
  grid-column: 2 / 4;
  gap: 7px;
}

.source-card-actions .secondary-button {
  min-height: 35px;
  padding: 0 12px;
}

.source-card-actions .icon-button {
  width: 35px;
  height: 35px;
  border: 1px solid #e3e8ed;
}

.source-card-actions .delete {
  color: var(--red);
}

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

.content-inbox > .empty-state {
  grid-column: 1 / -1;
}

.content-card {
  display: flex;
  min-width: 0;
  border: 1px solid #edf0f3;
  border-radius: 16px;
  padding: 20px;
  flex-direction: column;
  background: #fff;
  transition: 0.18s ease;
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.content-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.content-source {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}

.content-source span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-date {
  color: #98a2b3;
  font-size: 11px;
  white-space: nowrap;
}

.content-card h3 {
  display: -webkit-box;
  overflow: hidden;
  margin: 15px 0 8px;
  font-size: 18px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.content-card > p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 47px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.content-card-controls {
  display: flex;
  margin-top: 16px;
  align-items: center;
  gap: 10px;
  border-top: 1px solid #edf0f3;
  padding-top: 14px;
  flex-wrap: wrap;
}

.content-card-controls > a {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.content-card-controls .row-actions {
  margin-left: auto;
}

.content-card.content-ignored {
  opacity: 0.58;
}

.content-card.content-used {
  border-color: #cfeeda;
}

.source-query-field[hidden],
#source-url-field[hidden] {
  display: none;
}

.inbox-bulk-bar {
  position: sticky;
  z-index: 8;
  top: 106px;
  display: flex;
  min-height: 58px;
  margin: -4px 0 18px;
  align-items: center;
  gap: 16px;
  border: 1px solid #e5e9ee;
  border-radius: 14px;
  padding: 9px 11px 9px 17px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.inbox-bulk-bar > span {
  color: var(--muted);
  font-size: 10px;
}

.inbox-bulk-bar .primary-button {
  margin-left: auto;
}

.bulk-select {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  font-weight: 780;
}

.bulk-select input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.content-card {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.content-card.is-selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.1), var(--shadow);
}

.content-card-body {
  display: flex;
  min-width: 0;
  padding: 20px;
  flex: 1;
  flex-direction: column;
}

.content-select {
  position: absolute;
  z-index: 3;
  top: 13px;
  left: 13px;
  cursor: pointer;
}

.content-select input {
  position: absolute;
  opacity: 0;
}

.content-select span {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 2px solid #d0d7df;
  border-radius: 9px;
  color: transparent;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
  font-size: 10px;
}

.content-select input:checked + span {
  color: #fff;
  border-color: var(--green);
  background: var(--green);
}

.content-select.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.content-cover {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
}

.content-card:not(:has(.content-cover)) .content-card-head {
  padding-left: 35px;
}

.content-card-body > p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 58px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.content-ai-line {
  display: flex;
  margin-top: 14px;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.content-ai-line > span,
.content-ai-line > em {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
}

.content-ai-line > em {
  color: #697586;
  background: #f1f3f5;
}

.ai-pending { color: #687386; background: #eef1f4; }
.ai-running { color: #7252bf; background: #f1ecff; }
.ai-ready { color: #168541; background: var(--green-soft); }
.ai-error { color: #c43838; background: var(--red-soft); }

.content-ai-reason {
  display: flex;
  margin-top: 13px;
  gap: 9px;
  border-radius: 10px;
  padding: 10px 11px;
  color: #695334;
  background: #fff8e8;
  font-size: 12px;
  line-height: 1.5;
}

.content-ai-reason i {
  margin-top: 2px;
  color: #d8941d;
}

.content-channel-field {
  display: grid;
  margin-top: 16px;
  gap: 6px;
}

.content-channel-field > span {
  font-size: 12px;
  font-weight: 780;
}

.content-channel-field select {
  width: 100%;
  min-height: 39px;
  border: 1px solid #dfe5ea;
  border-radius: 9px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.content-channel-field small {
  color: var(--muted);
  font-size: 10px;
}

.content-card-controls .content-channel-field {
  display: flex;
  min-width: 420px;
  margin: 0;
  flex: 1 1 520px;
  align-items: center;
  gap: 9px;
}

.content-card-controls .content-channel-field > span {
  white-space: nowrap;
}

.content-card-controls .content-channel-field select {
  width: auto;
  min-width: 180px;
  max-width: 300px;
  flex: 1 1 240px;
}

.content-card-controls .content-channel-field small {
  overflow: hidden;
  max-width: 150px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-options {
  display: grid;
  margin-top: 13px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.content-options label {
  cursor: pointer;
}

.content-options input {
  position: absolute;
  opacity: 0;
}

.content-options span {
  display: flex;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  border: 1px solid #e3e8ed;
  border-radius: 9px;
  padding: 7px 9px;
  color: #7c8796;
  background: #fff;
  font-size: 10px;
  font-weight: 700;
}

.content-options input:checked + span {
  color: var(--green-dark);
  border-color: #b6dfc5;
  background: var(--green-soft);
}

.content-options label.is-disabled {
  opacity: 0.43;
  cursor: not-allowed;
}

.rewrite-preparation-summary {
  display: flex;
  margin-bottom: 16px;
  align-items: center;
  gap: 11px;
  border-radius: 12px;
  padding: 12px 14px;
  color: #315f44;
  background: var(--green-soft);
}

.rewrite-preparation-summary > i {
  font-size: 18px;
}

.rewrite-preparation-summary div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.rewrite-preparation-summary b {
  font-size: 12px;
}

.rewrite-preparation-summary span {
  color: #678274;
  font-size: 10px;
}

.rewrite-preparation-list {
  display: grid;
  gap: 14px;
}

.rewrite-preparation-item {
  border: 1px solid #e4e9ee;
  border-radius: 14px;
  padding: 16px;
  background: #fbfcfd;
}

.rewrite-preparation-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  align-items: end;
  gap: 18px;
}

.rewrite-preparation-head > div > span,
.rewrite-preparation-head label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.rewrite-preparation-head h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.rewrite-preparation-head select {
  width: 100%;
  min-height: 40px;
  border: 1px solid #dfe5ea;
  border-radius: 9px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 11px;
}

.rewrite-preparation-item > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.rewrite-preparation-options {
  margin-top: 14px;
  border-top: 1px solid #e5e9ee;
  padding-top: 13px;
}

.rewrite-preparation-options > b {
  font-size: 11px;
}

.rewrite-preparation-options .content-options {
  margin-top: 9px;
}

#rewrite-preparation-modal .modal-card {
  width: min(100%, 920px);
}

.content-processing {
  margin-top: 13px;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 11px;
  font-weight: 720;
}

.content-card-controls .content-processing {
  display: inline-flex;
  overflow: hidden;
  max-width: 280px;
  min-height: 35px;
  margin: 0;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.telegram-preview-card {
  overflow: hidden;
  border: 1px solid #e5e9ee;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
}

.telegram-card-toolbar {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 14px;
}

.telegram-device {
  border-top: 1px solid #edf0f3;
  border-bottom: 1px solid #edf0f3;
}

.telegram-device > header {
  display: flex;
  min-height: 57px;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: #fff;
}

.telegram-device > header > div {
  display: grid;
  gap: 2px;
}

.telegram-device > header b {
  font-size: 11px;
}

.telegram-device > header small {
  color: #87919d;
  font-size: 8px;
}

.telegram-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #56b6e9, #278bc7);
  font-size: 10px;
  font-weight: 850;
}

.telegram-chat {
  min-height: 350px;
  padding: 18px 14px 25px;
  background-color: #c8d7de;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,.25) 0 2px, transparent 2px),
    radial-gradient(circle at 75% 60%, rgba(255,255,255,.18) 0 2px, transparent 2px);
  background-size: 38px 38px, 45px 45px;
}

.telegram-bubble {
  position: relative;
  overflow: hidden;
  max-width: 94%;
  margin-left: auto;
  border-radius: 13px 13px 4px 13px;
  padding: 0 0 20px;
  background: #e3ffc7;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.15);
}

.telegram-bubble > img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 240px;
  margin: 0;
  object-fit: cover;
}

.telegram-message {
  padding: 10px 11px 0;
  overflow-wrap: anywhere;
  color: #17212b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.telegram-message a {
  color: #168ac3;
}

.telegram-message blockquote {
  margin: 8px 0;
  border-left: 3px solid #5caf6b;
  padding-left: 8px;
}

.telegram-bubble time {
  position: absolute;
  right: 9px;
  bottom: 6px;
  color: #6d8a70;
  font-size: 7px;
}

.telegram-bubble time i {
  color: #4b9ac5;
}

.telegram-preview-card > footer {
  display: grid;
  gap: 4px;
  padding: 13px 15px 15px;
}

.telegram-preview-card > footer b {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-preview-card > footer span {
  color: var(--muted);
  font-size: 8px;
}

.scheduler-status-card {
  text-align: center;
}

.scheduler-big-icon {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 8px auto 16px;
  place-items: center;
  border-radius: 22px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 27px;
}

.scheduler-status-card .status-badge {
  margin: 0 auto 13px;
}

.scheduler-status-card h3 {
  margin: 0;
  font-size: 18px;
}

.scheduler-status-card > p {
  max-width: 420px;
  margin: 8px auto 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.scheduler-status-card dl {
  margin: 0;
  border-top: 1px solid #edf0f3;
}

.scheduler-status-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #edf0f3;
  padding: 13px 0;
  font-size: 10px;
}

.scheduler-status-card dt {
  color: var(--muted);
}

.scheduler-status-card dd {
  margin: 0;
  font-weight: 750;
}

.workflow-list {
  display: flex;
  margin: 0;
  padding: 0;
  flex-direction: column;
  list-style: none;
}

.workflow-list li {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 20px;
}

.workflow-list li:not(:last-child)::before {
  position: absolute;
  top: 29px;
  bottom: 3px;
  left: 14px;
  width: 1px;
  background: #dfe6ea;
  content: "";
}

.workflow-list li > span {
  position: relative;
  z-index: 1;
  display: grid;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #ccefd7;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 10px;
  font-weight: 850;
}

.workflow-list b {
  display: block;
  font-size: 12px;
}

.workflow-list p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.sidebar-backdrop {
  display: none;
}

.modal-shell,
.confirm-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  visibility: hidden;
  padding: 24px;
  place-items: center;
  opacity: 0;
  transition: 0.2s ease;
}

.modal-shell.open,
.confirm-shell.open {
  visibility: visible;
  opacity: 1;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
}

.modal-card,
.confirm-card {
  position: relative;
  z-index: 1;
  width: min(100%, 580px);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border-radius: 20px;
  padding: 30px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
  transform: translateY(12px) scale(0.98);
  transition: 0.2s ease;
}

.modal-wide .modal-card {
  width: min(100%, 820px);
}

.modal-shell.open .modal-card,
.confirm-shell.open .confirm-card {
  transform: none;
}

.modal-close {
  position: absolute;
  top: 17px;
  right: 17px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: #8491a1;
  background: #f1f4f6;
}

.modal-icon {
  display: grid;
  width: 45px;
  height: 45px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 13px;
  font-size: 18px;
}

.modal-icon-blue { color: #238bc7; background: var(--blue-soft); }
.modal-icon-green { color: var(--green-dark); background: var(--green-soft); }
.modal-icon-red { color: var(--red); background: var(--red-soft); }
.modal-icon-orange { color: #d97706; background: var(--orange-soft); }

.modal-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.modal-lead {
  max-width: 500px;
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.post-schedule-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  border: 1px solid #e5e1f8;
  border-radius: 13px;
  padding: 13px;
  background: #faf9ff;
}

.post-schedule-summary > span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #7157d9;
  background: var(--purple-soft);
}

.post-schedule-summary > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.post-schedule-summary small,
.post-schedule-summary em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
}

.post-schedule-summary b {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  margin-bottom: 15px;
  flex-direction: column;
}

.field > span {
  margin-bottom: 7px;
  color: #475467;
  font-size: 10px;
  font-weight: 750;
}

.field > span em {
  color: var(--red);
  font-style: normal;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid #dfe5ea;
  border-radius: 10px;
  outline: 0;
  color: var(--ink);
  background: #fff;
  font-size: 11px;
  transition: 0.18s ease;
}

.field input,
.field select {
  height: 43px;
  padding: 0 12px;
}

.field textarea {
  resize: vertical;
  padding: 13px;
  line-height: 1.55;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.field small {
  margin-top: 6px;
  color: #98a2b3;
  font-size: 8px;
}

.telegram-editor {
  overflow: hidden;
  border: 1px solid #dfe5ea;
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.telegram-editor:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.format-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 47px;
  border-bottom: 1px solid #e8edf1;
  padding: 7px 8px;
  background: #f8fafb;
}

.editor-format-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.editor-format-group + .editor-format-group {
  border-left: 1px solid #e1e7ec;
  padding-left: 8px;
}

.format-toolbar button {
  display: inline-flex;
  min-width: 31px;
  height: 31px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 7px;
  padding: 0 8px;
  color: #667085;
  background: transparent;
  font-size: 10px;
  transition: 0.16s ease;
}

.format-toolbar button:hover,
.format-toolbar button.active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.editor-mode-switch {
  display: flex;
  gap: 2px;
  margin-left: auto;
  border: 1px solid #dfe5ea;
  border-radius: 8px;
  padding: 2px;
  background: #fff;
}

.editor-mode-switch button {
  gap: 5px;
  min-width: auto;
  height: 27px;
  padding: 0 9px;
  font-size: 8px;
  font-weight: 800;
}

.post-visual-editor,
.post-source-editor {
  display: block;
  width: 100%;
  min-height: 210px;
  max-height: 430px;
  overflow-y: auto;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0;
  padding: 17px 18px;
  color: var(--ink);
  background: #fff;
  box-shadow: none !important;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.post-source-editor {
  display: none;
  resize: vertical;
  color: #344054;
  background: #fbfcfd;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  tab-size: 2;
  white-space: pre-wrap;
}

.telegram-editor.source-mode .post-visual-editor {
  display: none;
}

.telegram-editor.source-mode .post-source-editor {
  display: block;
}

.post-visual-editor:empty::before {
  color: #98a2b3;
  content: attr(data-placeholder);
  pointer-events: none;
}

.post-visual-editor blockquote {
  margin: 9px 0;
  border-left: 3px solid #37aee2;
  padding: 4px 0 4px 12px;
  color: #344054;
}

.post-visual-editor blockquote[expandable]::after {
  display: inline-flex;
  margin-left: 7px;
  border-radius: 999px;
  padding: 1px 6px;
  color: #667085;
  background: #edf2f6;
  content: "сворачиваемая";
  font-size: 7px;
  font-weight: 800;
}

.post-visual-editor code {
  border-radius: 4px;
  padding: 1px 4px;
  color: #b42318;
  background: #f2f4f7;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.post-visual-editor pre {
  overflow-x: auto;
  margin: 9px 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: #e5e7eb;
  background: #17202c;
  font-family: "SFMono-Regular", Consolas, monospace;
  white-space: pre-wrap;
}

.post-visual-editor pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.post-visual-editor .tg-spoiler {
  border-radius: 3px;
  color: transparent;
  background: #667085;
  cursor: pointer;
  text-shadow: none;
}

.post-visual-editor .tg-spoiler:hover,
.post-visual-editor .tg-spoiler:focus {
  color: inherit;
  background: #eaecf0;
}

.editor-status {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #edf0f2;
  padding: 0 11px;
  color: #98a2b3;
  background: #fbfcfd;
  font-size: 8px;
}

.editor-status span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.editor-status span i {
  color: #2aabee;
}

.editor-status small {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.schedule-box {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(175px, 0.8fr) auto auto;
  gap: 11px;
  align-items: center;
  border: 1px solid #dcefe3;
  border-radius: 13px;
  padding: 13px;
  background: #fbfefc;
}

.schedule-box > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.schedule-box > div > i {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  color: var(--green-dark);
  background: var(--green-soft);
}

.schedule-box > div div {
  display: flex;
  flex-direction: column;
}

.schedule-box b {
  font-size: 10px;
}

.schedule-box > div span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
}

.schedule-box .field {
  margin: 0;
}

.schedule-box .field span {
  font-size: 8px;
}

.schedule-box .field input {
  height: 37px;
  font-size: 9px;
}

.status-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.schedule-box > .status-choice {
  align-self: end;
  margin: 0;
}

.status-choice span {
  display: inline-flex;
  height: 37px;
  align-items: center;
  gap: 6px;
  border: 1px solid #dfe5ea;
  border-radius: 9px;
  padding: 0 10px;
  color: #667085;
  background: #fff;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.status-choice input:checked + span {
  border-color: var(--green);
  color: var(--green-dark);
  background: var(--green-soft);
}

.form-message {
  display: none;
  margin-top: 13px;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 10px;
}

.form-message.show {
  display: block;
}

.form-message.error {
  color: #b42318;
  background: var(--red-soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.confirm-card {
  width: min(100%, 390px);
  text-align: center;
}

.confirm-card .modal-icon {
  margin: 0 auto 15px;
}

.confirm-card h3 {
  margin: 0;
  font-size: 18px;
}

.confirm-card p {
  margin: 8px 0 21px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.confirm-card > div {
  display: flex;
  justify-content: center;
  gap: 9px;
}

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  width: min(360px, calc(100vw - 44px));
  flex-direction: column;
  gap: 9px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e1e7eb;
  border-radius: 12px;
  padding: 13px 15px;
  background: #fff;
  box-shadow: var(--shadow);
  animation: toast-in 0.22s ease;
  font-size: 10px;
  font-weight: 650;
}

.toast i {
  color: var(--green);
}

.toast.error i {
  color: var(--red);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(15px); }
  to { opacity: 1; transform: none; }
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-comments-toggle {
  display: flex;
  margin-top: 0;
  align-items: center;
  gap: 11px;
  border: 1px solid #e3e8ed;
  border-radius: 12px;
  padding: 13px 14px;
  background: #fafbfc;
  cursor: pointer;
}

.channel-comments-row {
  position: relative;
  margin: 0;
}

.channel-comments-row .channel-comments-toggle {
  padding-right: 46px;
}

.channel-comments-row > .strategy-help-button {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
}

.channel-comments-row > .strategy-help-button:hover,
.channel-comments-row > .strategy-help-button:focus-visible {
  transform: translateY(calc(-50% - 1px));
}

.channel-comments-toggle > input {
  position: absolute;
  opacity: 0;
}

.channel-comments-toggle > span:last-child {
  display: grid;
  gap: 3px;
}

.channel-comments-toggle b {
  font-size: 10px;
}

.channel-comments-toggle small {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.45;
}

.toggle-switch {
  position: relative;
  width: 39px;
  height: 23px;
  flex: 0 0 39px;
  border-radius: 999px;
  background: #ccd4dc;
  transition: 0.18s ease;
}

.toggle-switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.18);
  content: "";
  transition: 0.18s ease;
}

.channel-comments-toggle > input:checked + .toggle-switch {
  background: var(--green);
}

.channel-comments-toggle > input:checked + .toggle-switch::after {
  transform: translateX(16px);
}

.source-policy-settings {
  display: grid;
  margin: 2px 0 0;
  gap: 8px;
  border: 1px solid #e3e8ed;
  border-radius: 14px;
  padding: 14px;
  background: #f8fafc;
}

.source-policy-settings legend {
  padding: 0 7px;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
}

.source-policy-toggle {
  background: #fff;
}

.source-policy-toggle b {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.source-policy-toggle b i {
  width: 14px;
  color: #69758a;
  text-align: center;
}

.source-policy-toggle small {
  font-size: 9px;
}

.source-policy-toggle.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.source-policy-anonymous {
  border-color: #d8d7f1;
  background: #f7f6ff;
}

.source-policy-anonymous > input:checked + .toggle-switch {
  background: #6e63d9;
}

.channel-comments-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #7a8491;
  background: #f0f3f5;
  font-size: 8px;
  font-weight: 750;
}

.channel-comments-state.is-connected {
  color: #168541;
  background: var(--green-soft);
}

.channel-card-tone,
.channel-comments-state,
.channel-strategy-summary span {
  display: inline-flex;
  height: 28px;
  max-width: 100%;
  overflow: hidden;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-card-tone i,
.channel-comments-state i,
.channel-strategy-summary i {
  flex: 0 0 auto;
}

.moderation-stat-grid {
  display: grid;
  margin-bottom: 17px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.moderation-stat-grid article {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 12px;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
}

.moderation-stat-grid article > div {
  display: grid;
  gap: 4px;
}

.moderation-stat-grid small {
  color: var(--muted);
  font-size: 8px;
}

.moderation-stat-grid b {
  font-size: 20px;
}

.moderation-stat-icon {
  display: grid;
  width: 41px;
  height: 41px;
  flex: 0 0 41px;
  place-items: center;
  border-radius: 12px;
  font-size: 14px;
}

.moderation-stat-icon.stat-blue { color: #278bc7; background: var(--blue-soft); }
.moderation-stat-icon.stat-orange { color: #c57a13; background: var(--orange-soft); }
.moderation-stat-icon.stat-green { color: #168541; background: var(--green-soft); }
.moderation-stat-icon.stat-red { color: #d33c3c; background: var(--red-soft); }

.moderation-workspace {
  display: grid;
  min-height: 620px;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid #e3e8ed;
  border-radius: 17px;
  background: #fff;
}

.moderation-publications-panel {
  min-width: 0;
  border-right: 1px solid #e7ebef;
  background: #fafbfc;
}

.moderation-panel-head {
  display: flex;
  min-height: 73px;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px 10px;
}

.moderation-panel-head h3 {
  margin: 3px 0 0;
  font-size: 14px;
}

.moderation-panel-head > span {
  display: grid;
  min-width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 9px;
  color: #7252bf;
  background: #f1ecff;
  font-size: 9px;
  font-weight: 850;
}

.moderation-search {
  display: flex;
  margin: 0 13px 12px;
  align-items: center;
  gap: 8px;
  border: 1px solid #e1e6eb;
  border-radius: 10px;
  padding: 0 10px;
  background: #fff;
}

.moderation-search i {
  color: #9aa4b0;
  font-size: 9px;
}

.moderation-search input {
  width: 100%;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 9px;
}

.moderation-publications {
  overflow-y: auto;
  max-height: 680px;
  padding: 0 9px 15px;
}

.moderation-channel-group + .moderation-channel-group {
  margin-top: 12px;
}

.moderation-channel-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  color: #697586;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.moderation-channel-group > header em {
  font-style: normal;
}

.moderation-publication {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.moderation-publication:hover {
  background: #fff;
}

.moderation-publication.active {
  border-color: #b9e4c7;
  background: var(--green-soft);
}

.moderation-publication-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #2aabee;
  font-size: 12px;
}

.moderation-publication > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.moderation-publication b {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moderation-publication small {
  color: var(--muted);
  font-size: 7px;
}

.moderation-publication > em {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #7f8995;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.moderation-publication > em.has-review {
  color: #b56d00;
}

.moderation-comments-panel {
  min-width: 0;
}

.moderation-selected-post {
  display: grid;
  min-height: 104px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #e8ecf0;
  padding: 14px 18px;
  background: #fff;
}

.moderation-post-avatar,
.comment-author-avatar {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #56b6e9, #278bc7);
  font-size: 10px;
  font-weight: 850;
}

.moderation-selected-post > div:nth-child(2) {
  min-width: 0;
}

.moderation-selected-post > div:nth-child(2) > span {
  color: #2aabee;
  font-size: 8px;
  font-weight: 800;
}

.moderation-selected-post h3 {
  overflow: hidden;
  margin: 5px 0;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moderation-selected-post p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moderation-post-summary {
  display: flex;
  gap: 6px;
}

.moderation-post-summary span {
  display: grid;
  min-width: 57px;
  gap: 3px;
  border-radius: 9px;
  padding: 7px 9px;
  color: var(--muted);
  background: #f4f6f8;
  font-size: 7px;
  text-align: center;
}

.moderation-post-summary b {
  color: var(--ink);
  font-size: 11px;
}

.moderation-post-summary .needs-review {
  color: #9a5f08;
  background: var(--orange-soft);
}

.moderation-comments-toolbar {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e8ecf0;
  padding: 9px 17px;
}

.moderation-status-tabs {
  display: flex;
  gap: 4px;
}

.moderation-status-tabs button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  color: #7b8592;
  background: transparent;
  font-size: 8px;
  font-weight: 760;
}

.moderation-status-tabs button.active {
  color: var(--green-dark);
  background: var(--green-soft);
}

.moderation-comments-toolbar > span {
  color: var(--muted);
  font-size: 8px;
}

.moderation-comments-feed {
  overflow-y: auto;
  max-height: 600px;
  min-height: 420px;
  padding: 15px 17px 22px;
  background: #f5f7f9;
}

.moderation-comments-feed > .empty-state {
  min-height: 390px;
}

.moderation-comment {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  border: 1px solid #e4e9ed;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.moderation-comment + .moderation-comment {
  margin-top: 10px;
}

.moderation-comment-review {
  border-color: #f2cf98;
  box-shadow: 0 0 0 2px rgba(235, 155, 31, 0.07);
}

.moderation-comment-deleted {
  opacity: 0.68;
}

.comment-author-avatar {
  width: 36px;
  height: 36px;
  font-size: 8px;
}

.comment-main {
  min-width: 0;
}

.comment-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.comment-head b {
  font-size: 10px;
}

.comment-head a {
  color: #2aabee;
  font-size: 8px;
  text-decoration: none;
}

.comment-head time {
  margin-left: auto;
  color: #9aa3ae;
  font-size: 7px;
}

.comment-reply {
  display: inline-flex;
  margin-top: 6px;
  align-items: center;
  gap: 5px;
  color: #7b8593;
  font-size: 7px;
}

.comment-main > p {
  margin: 8px 0 10px;
  color: #26313d;
  font-size: 10px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

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

.comment-verdict em {
  border-radius: 999px;
  padding: 4px 7px;
  color: #697586;
  background: #f0f3f5;
  font-size: 7px;
  font-style: normal;
}

.comment-ai-reason {
  display: flex;
  margin-top: 9px;
  gap: 7px;
  border-radius: 9px;
  padding: 8px 9px;
  color: #66517e;
  background: #f4effc;
  font-size: 8px;
  line-height: 1.45;
}

.comment-ai-reason i {
  margin-top: 2px;
  color: #8763b4;
}

.comment-error {
  margin-top: 8px;
  border-radius: 8px;
  padding: 7px 9px;
  color: #b42318;
  background: var(--red-soft);
  font-size: 8px;
}

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

.comment-actions button {
  min-height: 32px;
  padding: 0 9px;
  font-size: 8px;
}

.comment-actions .icon-button {
  width: 32px;
  align-self: flex-end;
}

.moderation-no-selection {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.moderation-switches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.moderation-settings-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-login-body {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  color: #18202d;
  background-color: #111922;
  background-image:
    radial-gradient(circle at 16% 18%, rgba(45, 196, 108, 0.2), transparent 28%),
    radial-gradient(circle at 82% 78%, rgba(56, 111, 164, 0.18), transparent 32%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.025) 0, rgba(255, 255, 255, 0.025) 1px, transparent 1px, transparent 18px),
    repeating-linear-gradient(25deg, rgba(255, 255, 255, 0.018) 0, rgba(255, 255, 255, 0.018) 1px, transparent 1px, transparent 24px),
    linear-gradient(145deg, #131d27 0%, #0e151d 100%);
}

.admin-login-body::before,
.admin-login-body::after {
  position: fixed;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 50%;
  pointer-events: none;
  content: "";
}

.admin-login-body::before {
  top: -260px;
  left: -180px;
  width: 720px;
  height: 720px;
}

.admin-login-body::after {
  right: -220px;
  bottom: -330px;
  width: 860px;
  height: 860px;
}

.admin-login-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.admin-login-card {
  width: min(100%, 450px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  padding: 42px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.admin-login-brand {
  position: static;
  display: block;
  margin-bottom: 40px;
}

.admin-login-brand strong {
  color: #1b2431;
  font-size: 18px;
  letter-spacing: 0.16em;
}

.admin-login-copy .eyebrow {
  margin-bottom: 10px;
  color: #22a95a;
}

.admin-login-copy h1 {
  margin: 0;
  font-size: clamp(29px, 5vw, 38px);
  font-weight: 850;
  letter-spacing: -0.045em;
  line-height: 1.08;
}

.admin-login-copy p {
  margin: 12px 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.admin-login-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #475467;
  font-size: 10px;
  font-weight: 750;
}

.input-with-icon {
  display: flex;
  height: 52px;
  align-items: center;
  border: 1px solid #dfe5ea;
  border-radius: 12px;
  padding: 0 16px;
  background: #fbfcfd;
  transition: 0.18s ease;
}

.input-with-icon:focus-within {
  border-color: var(--green);
  box-shadow: none;
}

.admin-login-form .input-with-icon input,
.admin-login-form .input-with-icon input:focus {
  width: 100%;
  border: 0 !important;
  outline: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #1f2937;
  font-size: 14px;
  appearance: none;
}

.admin-login-form .primary-button {
  height: 52px;
  margin-top: 4px;
  border-radius: 12px;
  font-size: 13px;
}

.form-alert {
  max-width: 480px;
  margin: -15px 0 18px;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 10px;
}

.form-alert-error {
  color: #b42318;
  background: var(--red-soft);
}

.admin-login-security {
  margin: 20px 0 0;
  color: #98a2b3;
  font-size: 10px;
  text-align: center;
}

.admin-login-visual {
  position: relative;
  display: grid;
  overflow: hidden;
  place-items: center;
  background:
    radial-gradient(circle at 70% 20%, rgba(34, 197, 94, 0.18), transparent 25%),
    radial-gradient(circle at 20% 80%, rgba(47, 128, 237, 0.12), transparent 30%),
    #121923;
}

.visual-orb {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
}

.visual-orb-one {
  width: 530px;
  height: 530px;
}

.visual-orb-two {
  width: 760px;
  height: 760px;
}

.telegram-preview {
  position: relative;
  z-index: 1;
  width: min(440px, 74%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 23px;
  padding: 26px;
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  transform: rotate(-2deg);
}

.telegram-preview-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.telegram-preview-head .channel-avatar {
  background: linear-gradient(135deg, #2aabee, #1877b8);
}

.telegram-preview-head div {
  display: flex;
  flex-direction: column;
}

.telegram-preview-head b {
  font-size: 12px;
}

.telegram-preview-head small {
  margin-top: 3px;
  color: #9eabb9;
  font-size: 9px;
}

.telegram-preview-post {
  margin-top: 22px;
  border-radius: 16px;
  padding: 22px;
  color: var(--ink);
  background: #fff;
}

.preview-label {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.telegram-preview-post b {
  display: block;
  margin: 14px 0 7px;
  font-size: 14px;
}

.telegram-preview-post p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.telegram-preview-post time {
  display: block;
  margin-top: 17px;
  color: #98a2b3;
  font-size: 8px;
  text-align: right;
}

.system-settings-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 22px;
  margin-bottom: 22px;
}

.system-settings-card,
.system-runtime-panel {
  min-width: 0;
}

.system-settings-card .panel-head p,
.system-runtime-panel .panel-head p {
  max-width: 680px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.system-card-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 13px;
  font-size: 16px;
}

.system-card-icon-green {
  color: var(--green-dark);
  background: var(--green-soft);
}

.system-card-icon-purple {
  color: #7055d8;
  background: var(--purple-soft);
}

.system-card-icon-blue {
  color: #2779c7;
  background: #eaf4ff;
}

.telegram-review-connect {
  display: grid;
  gap: 11px;
  border: 1px solid #dce8f5;
  border-radius: 15px;
  padding: 17px;
  background: #f7fbff;
}

.telegram-review-connect .status-badge {
  justify-self: start;
}

.telegram-review-connect p,
.telegram-review-connect small {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.telegram-review-connect code {
  overflow-x: auto;
  border: 1px dashed #8ebbe4;
  border-radius: 10px;
  padding: 12px;
  color: #1f5f99;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.system-automation-toggle {
  min-height: 82px;
  align-items: flex-start;
  border-color: #dce9e1;
  padding: 17px;
  background: #f7fcf9;
}

.system-automation-toggle .toggle-switch {
  margin-top: 2px;
}

.system-automation-toggle b {
  font-size: 12px;
}

.system-automation-toggle small {
  font-size: 10px;
  line-height: 1.55;
}

.system-pause-note {
  display: flex;
  margin-top: 12px;
  align-items: flex-start;
  gap: 9px;
  border-radius: 11px;
  padding: 12px 13px;
  color: #7b6433;
  background: #fff8e8;
}

.system-pause-note i {
  margin-top: 2px;
  color: #e0a126;
}

.system-pause-note p {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
}

.system-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.system-settings-grid .field input {
  font-size: 13px;
  font-weight: 750;
}

.system-settings-actions {
  display: flex;
  margin-top: 18px;
  justify-content: flex-end;
}

.system-runtime-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.system-runtime-card {
  display: grid;
  min-height: 104px;
  align-content: start;
  gap: 8px;
  border: 1px solid #e9edf1;
  border-radius: 13px;
  padding: 15px;
  background: #fafbfc;
}

.system-runtime-card span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.system-runtime-card span i {
  color: #7d8ba0;
}

.system-runtime-card b {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.system-runtime-model-card {
  min-height: 142px;
}

.system-runtime-model-card small {
  color: #7a8799;
  font-size: 9px;
  line-height: 1.45;
}

.system-runtime-model-card-premium {
  border-color: #ddd8ff;
  background: linear-gradient(145deg, #fbfaff, #f7f5ff);
}

.system-runtime-model-card-premium > span i {
  color: #7357e8;
}

.system-runtime-card em {
  width: max-content;
  border-radius: 999px;
  padding: 4px 7px;
  color: #8a5b00;
  background: var(--orange-soft);
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.system-runtime-card .is-ready {
  width: max-content;
  border-radius: 999px;
  padding: 4px 7px;
  color: #168541;
  background: var(--green-soft);
}

.system-runtime-card .is-error {
  width: max-content;
  border-radius: 999px;
  padding: 4px 7px;
  color: #d73b3b;
  background: var(--red-soft);
}

@media (max-width: 1240px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .channels-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .telegram-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .moderation-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-settings-layout {
    grid-template-columns: 1fr;
  }

  .system-runtime-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .moderation-workspace {
    grid-template-columns: minmax(250px, 290px) minmax(0, 1fr);
  }

  .moderation-post-summary {
    display: none;
  }

  .plan-post {
    grid-template-columns: 92px minmax(0, 1fr) 140px auto;
  }

  .plan-post > .status-badge {
    display: none;
  }

  .scheduler-pill {
    display: none;
  }
}

@media (max-width: 960px) {
  .admin-sidebar {
    width: 286px;
    transform: translateX(-100%);
  }

  .admin-sidebar.open {
    transform: none;
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid !important;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(15, 23, 42, 0.5);
  }

  .sidebar-backdrop.open {
    display: block;
  }

  .admin-main {
    margin-left: 0;
  }

  .overview-grid,
  .scheduler-grid {
    grid-template-columns: 1fr;
  }

  .admin-login-shell {
    grid-template-columns: 1fr;
  }

  .admin-login-visual {
    display: none;
  }

  .moderation-workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .moderation-publications-panel {
    border-right: 0;
    border-bottom: 1px solid #e7ebef;
  }

  .moderation-publications {
    max-height: 340px;
  }

  .moderation-settings-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .admin-topbar {
    min-height: 78px;
    padding: 13px 16px;
  }

  .topbar-title .eyebrow {
    display: none;
  }

  .topbar-title h1 {
    font-size: 17px;
  }

  .topbar-actions .secondary-button {
    display: none;
  }

  .topbar-actions .primary-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .system-settings-grid,
  .system-runtime-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions .primary-button span {
    display: none;
  }

  .admin-content {
    padding: 20px 14px 40px;
  }

  .stat-grid,
  .channels-grid,
  .sources-grid,
  .content-inbox {
    grid-template-columns: 1fr;
  }

  .telegram-preview-grid {
    grid-template-columns: 1fr;
  }

  .inbox-bulk-bar {
    top: 86px;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .inbox-bulk-bar .primary-button {
    width: 100%;
    margin-left: 0;
  }

  .content-options {
    grid-template-columns: 1fr;
  }

  .rewrite-preparation-head {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .channel-connect-guide {
    grid-template-columns: 1fr;
  }

  .channel-connect-guide > div {
    min-height: 0;
  }

  .section-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .moderation-stat-grid,
  .moderation-switches,
  .moderation-settings-row {
    grid-template-columns: 1fr;
  }

  .moderation-selected-post {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .moderation-comments-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .moderation-status-tabs {
    width: 100%;
    overflow-x: auto;
  }

  .moderation-comment {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .comment-actions {
    grid-column: 2;
    flex-direction: row;
  }

  .section-heading {
    flex-direction: column;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar > label {
    min-width: 0;
  }

  .view-toggle {
    align-self: flex-end;
  }

  .plan-post {
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 14px 12px;
  }

  .plan-post > .channel-chip {
    display: none;
  }

  .upcoming-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .upcoming-item > .channel-chip {
    display: none;
  }

  .form-row,
  .schedule-box {
    grid-template-columns: 1fr;
  }

  .schedule-box {
    align-items: stretch;
  }

  .schedule-box > .status-choice {
    align-self: stretch;
  }

  .status-choice span {
    width: 100%;
    justify-content: center;
  }

  .format-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .editor-mode-switch {
    width: 100%;
    margin-left: 0;
  }

  .editor-mode-switch button {
    flex: 1;
  }

  .modal-shell,
  .confirm-shell {
    padding: 10px;
  }

  .modal-card {
    max-height: calc(100vh - 20px);
    border-radius: 16px;
    padding: 22px 18px;
  }

  .admin-login-card {
    min-height: 0;
    border-radius: 20px;
    padding: 32px 24px;
  }

  .admin-login-brand {
    margin-bottom: 34px;
  }
}

.channel-card-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 720px) {
  .channel-card-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-card-controls .content-channel-field {
    display: grid;
    min-width: 0;
    flex-basis: 100%;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .content-card-controls .content-channel-field select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .content-card-controls .content-channel-field small {
    max-width: none;
    grid-column: 2;
  }
}
