:root {
  color-scheme: light;
  --bg: #f7f6fb;
  --surface: #ffffff;
  --surface-soft: #f0edf8;
  --surface-strong: #e6e0f2;
  --text: #171624;
  --muted: #5f5b73;
  --subtle: #858097;
  --line: #d8d2e7;
  --primary: #4338ca;
  --primary-strong: #3326a9;
  --primary-soft: #e4e1ff;
  --secondary: #64748b;
  --danger: #ba1a1a;
  --warning: #b45309;
  --success: #15803d;
  --telegram: #229ed9;
  --instagram: #c13584;
  --vk: #0077ff;
  --shadow: 0 18px 45px rgba(57, 48, 102, 0.12);
  --shadow-soft: 0 10px 24px rgba(57, 48, 102, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

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

button,
a,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(67, 56, 202, 0.32);
  outline-offset: 3px;
}

.material-symbols-outlined {
  direction: ltr;
  display: inline-block;
  flex: 0 0 auto;
  font-family: "Material Symbols Outlined";
  font-feature-settings: "liga";
  font-size: 22px;
  font-style: normal;
  font-weight: normal;
  letter-spacing: normal;
  line-height: 1;
  text-transform: none;
  white-space: nowrap;
  width: 1em;
  overflow: hidden;
  text-align: center;
  word-wrap: normal;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 450, "GRAD" 0, "opsz" 24;
}

.fill-icon,
.selected .material-symbols-outlined,
.preview-actions button[aria-pressed="true"] .material-symbols-outlined {
  font-variation-settings: "FILL" 1, "wght" 500, "GRAD" 0, "opsz" 24;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  width: 280px;
  height: 100vh;
  flex: 0 0 280px;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  border-right: 1px solid rgba(216, 210, 231, 0.85);
  background: rgba(255, 255, 255, 0.76);
  padding: 22px;
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.brand-mark,
.preview-avatar,
.vk-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 28px rgba(67, 56, 202, 0.28);
}

.brand h1,
.brand p,
.topbar-title span,
.topbar-title strong,
.panel h3,
.hero-card h2,
.activity-list p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  line-height: 1;
}

.brand p,
.hero-copy,
.activity-list p,
.sidebar-card p,
.media-copy p,
.preview-header span {
  color: var(--muted);
}

.primary-action,
.secondary-button,
.ghost-button,
.icon-button,
.vk-button,
.platform-chip,
.editor-toolbar button,
.preview-tabs button,
.preview-actions button {
  align-items: center;
  border: 0;
  display: inline-flex;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, transform 180ms ease;
}

.primary-action {
  width: 100%;
  border-radius: 18px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  padding: 12px 16px;
  box-shadow: 0 12px 26px rgba(67, 56, 202, 0.24);
}

.primary-action:hover {
  background: var(--primary-strong);
  box-shadow: 0 16px 32px rgba(67, 56, 202, 0.3);
}

.primary-action:active,
.secondary-button:active,
.ghost-button:active,
.icon-button:active,
.platform-chip:active,
.preview-actions button:active {
  transform: translateY(1px);
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-link {
  align-items: center;
  border-radius: 999px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  min-height: 44px;
  padding: 10px 14px;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-button {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.nav-chevron {
  margin-left: auto;
  transition: transform 180ms ease;
}

.nav-button[aria-expanded="true"] .nav-chevron,
.events-toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

.activity-menu {
  margin: 6px 0 4px 34px;
  border-radius: 18px;
  background: var(--surface);
  padding: 10px;
  box-shadow: var(--shadow-soft);
}

.activity-menu.bottom {
  margin: 10px 0 0;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.activity-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.compact-button {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.sidebar-card {
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(246, 244, 251, 0.9);
  padding: 16px;
}

.sidebar-card-title {
  font-weight: 800;
}

.queue-meter {
  height: 8px;
  margin: 14px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.queue-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.main-panel {
  min-width: 0;
  flex: 1;
}

.bottom-events {
  max-width: 1200px;
  margin: 0 auto 28px;
  padding: 0 28px;
}

.events-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid rgba(216, 210, 231, 0.92);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font-weight: 800;
  padding: 12px 16px;
  box-shadow: var(--shadow-soft);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  border-bottom: 1px solid rgba(216, 210, 231, 0.78);
  background: rgba(251, 249, 255, 0.82);
  padding: 12px 28px;
  backdrop-filter: blur(18px);
}

.topbar-title {
  display: grid;
  min-width: 184px;
}

.topbar-spacer {
  flex: 1;
}

.topbar-title span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-title strong {
  font-size: 18px;
}

.vk-button {
  margin-left: auto;
  border-radius: 999px;
  background: #eaf3ff;
  color: #07569f;
  font-weight: 800;
  padding: 10px 14px;
}

.vk-button:hover {
  background: #d9ebff;
}

.vk-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--vk);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
}

.icon-button:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px;
}

.workspace {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.hero-card,
.panel {
  border: 1px solid rgba(216, 210, 231, 0.88);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  overflow: hidden;
  padding: 22px;
  position: relative;
}

.hero-card::after {
  display: none;
}

.eyebrow {
  margin: 0 0 8px;
}

.hero-card h2 {
  max-width: 760px;
  font-size: clamp(26px, 3vw, 34px);
  letter-spacing: -0.04em;
  line-height: 1.08;
}

.hero-copy {
  max-width: 680px;
  font-size: 15px;
  margin: 8px 0 0;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-stats div {
  display: flex;
  flex: 1 1 128px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  gap: 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  padding: 14px 16px;
}

.hero-stats span {
  color: var(--muted);
  font-weight: 700;
}

.hero-stats strong {
  font-size: 24px;
}

.danger {
  color: var(--danger);
}

.panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  margin-bottom: 14px;
}

.panel h3 {
  font-size: 22px;
  letter-spacing: -0.02em;
}

.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.integration-card {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  border: 1px solid rgba(216, 210, 231, 0.9);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(228, 225, 255, 0.56), rgba(255, 255, 255, 0.9));
  padding: 14px;
}

.access-panel {
  display: block;
}

.access-panel summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.access-panel summary::-webkit-details-marker {
  display: none;
}

.access-panel summary::after {
  content: "expand_more";
  direction: ltr;
  display: inline-block;
  font-family: "Material Symbols Outlined";
  font-size: 22px;
  font-feature-settings: "liga";
  transition: transform 180ms ease;
}

.access-panel[open] summary::after {
  transform: rotate(180deg);
}

.access-panel summary small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.access-panel-body {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.integration-grid,
.attachment-fields {
  display: grid;
  gap: 10px;
}

.integration-grid {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.vk-token-grid {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.45fr) auto;
}

.integration-grid label,
.attachment-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.integration-grid input,
.attachment-fields input,
.attachment-fields select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

.helper-text {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.platform-chip {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  padding: 10px 14px;
}

.platform-svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  flex: 0 0 auto;
}

.platform-chip:hover {
  border-color: rgba(67, 56, 202, 0.44);
  color: var(--primary-strong);
}

.platform-chip:disabled {
  border-color: var(--line);
  background: #f1eef7;
  color: var(--subtle);
  opacity: 0.72;
}

.platform-chip.selected {
  border-color: transparent;
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: none;
}

.editor-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  background: #fbfaff;
  padding: 10px;
}

.editor-toolbar button {
  width: 40px;
  min-height: 40px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
}

.editor-toolbar button:hover {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  margin: 0 6px;
  background: var(--line);
}

textarea {
  display: block;
  width: 100%;
  min-height: 190px;
  resize: vertical;
  border: 0;
  color: var(--text);
  outline: 0;
  padding: 18px;
}

.editor-card:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(67, 56, 202, 0.1);
}

.editor-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 10px 18px;
}

.media-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 112px;
  margin-top: 14px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-lg);
  background: #fbfaff;
  padding: 16px;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.media-card:hover,
.media-card.is-dragover {
  border-color: var(--primary);
  background: #f3f1ff;
}

.attachment-fields {
  grid-template-columns: minmax(160px, 0.35fr) minmax(0, 1fr);
  margin-top: 12px;
}

.attachment-fields .helper-text {
  grid-column: 1 / -1;
}

.media-copy {
  display: flex;
  align-items: center;
  gap: 12px;
}

.media-copy > .material-symbols-outlined {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.media-copy strong,
.media-copy p {
  display: block;
  margin: 0;
}

.attachment-strip {
  display: flex;
  min-width: 92px;
  justify-content: flex-end;
}

.attachment-thumb {
  position: relative;
  width: 92px;
  height: 92px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.attachment-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-thumb button {
  position: absolute;
  right: 6px;
  top: 6px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  line-height: 0;
  padding: 0;
}

.attachment-thumb button .material-symbols-outlined {
  font-size: 18px;
}

.schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
}

.schedule-grid > .secondary-button {
  align-self: end;
  height: 44px;
}

.schedule-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.schedule-grid input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
}

.secondary-button,
.ghost-button {
  border-radius: 999px;
  font-weight: 800;
  padding: 10px 14px;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary-strong);
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: rgba(67, 56, 202, 0.36);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.ghost-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #146c2e;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.action-row .publish {
  width: auto;
}

.result-card {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 14px;
}

.result-card > strong {
  font-size: 15px;
}

.result-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-radius: 16px;
  padding: 10px;
}

.result-item.success {
  background: #ecfdf3;
  color: #14532d;
}

.result-item.failure {
  background: #fff7ed;
  color: #7c2d12;
}

.result-item code {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 3px 8px;
}

.result-item p {
  flex-basis: 100%;
  margin: 0;
}

.activity-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.activity-list.compact {
  gap: 8px;
}

.activity-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 12px;
}

.activity-list.compact li {
  grid-template-columns: auto minmax(0, 1fr);
  padding: 10px;
}

.activity-list.compact time {
  grid-column: 2;
}

.event-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 6px;
}

.event-dot.success {
  background: var(--success);
}

.event-dot.warning {
  background: var(--warning);
}

.event-dot.info {
  background: var(--primary);
}

time {
  color: var(--subtle);
  font-size: 12px;
}

.preview-panel {
  min-width: 0;
}

.preview-sticky {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 14px;
}

.preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}

.preview-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-weight: 800;
  padding: 8px 12px;
}

.preview-tabs button.active {
  border-color: transparent;
  background: var(--primary);
  color: #fff;
}

.preview-avatar.telegram {
  background: var(--telegram);
}

.preview-avatar.instagram {
  background: #262626;
}

.preview-avatar.vk {
  background: var(--vk);
}

.phone-frame {
  overflow: hidden;
  width: min(100%, 360px);
  max-width: 100%;
  min-height: 690px;
  border: 10px solid #221f2f;
  border-radius: 36px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.phone-top {
  display: flex;
  justify-content: center;
  height: 28px;
  background: #221f2f;
}

.phone-top span {
  width: 86px;
  height: 18px;
  border-radius: 0 0 14px 14px;
  background: #221f2f;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.preview-avatar {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  color: #fff;
  font-weight: 900;
}

.preview-header div:last-child {
  display: grid;
  min-width: 0;
}

.preview-header strong,
.preview-header span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-body {
  min-height: 514px;
  background:
    linear-gradient(135deg, rgba(67, 56, 202, 0.08), transparent),
    var(--surface-soft);
  padding: 16px;
}

.post-bubble {
  max-width: 94%;
  border: 1px solid rgba(216, 210, 231, 0.78);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(57, 48, 102, 0.08);
  padding: 14px;
}

.phone-frame.telegram .preview-body {
  background: #dbeafe;
}

.phone-frame.telegram .post-bubble {
  max-width: 88%;
  border: 0;
  border-radius: 18px 18px 18px 6px;
  background: #ffffff;
}

.phone-frame.telegram .preview-actions {
  background: #ffffff;
}

.phone-frame.instagram .preview-header {
  border-bottom-color: #efefef;
  background: #ffffff;
}

.phone-frame.instagram .preview-body {
  min-height: 514px;
  background: #ffffff;
  padding: 0;
}

.phone-frame.instagram .post-bubble {
  display: flex;
  max-width: 100%;
  min-height: 100%;
  flex-direction: column;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.phone-frame.instagram #previewMedia {
  order: 1;
  margin: 0;
  border: 0;
  border-top: 1px solid #efefef;
  border-bottom: 1px solid #efefef;
  border-radius: 0;
}

.phone-frame.instagram #previewImage {
  max-height: 340px;
  aspect-ratio: 1 / 1;
}

.phone-frame.instagram #previewText {
  order: 2;
  padding: 12px 14px 0;
}

.phone-frame.instagram .post-footer {
  order: 3;
  padding: 0 14px 14px;
}

.phone-frame.instagram .preview-actions {
  border-top-color: #efefef;
  background: #ffffff;
}

.phone-frame.vk .preview-body {
  background: #edeef0;
}

.phone-frame.vk .preview-header {
  border-bottom-color: #dce1e6;
  background: #ffffff;
}

.phone-frame.vk .post-bubble {
  max-width: 100%;
  border-color: #dce1e6;
  border-radius: 14px;
  box-shadow: none;
}

.phone-frame.vk .preview-actions {
  border-top-color: #dce1e6;
  background: #ffffff;
}

#previewText {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-bubble figure {
  margin: 12px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.post-bubble img {
  display: block;
  width: 100%;
  max-height: 230px;
  object-fit: cover;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.preview-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  border-top: 1px solid var(--line);
  background: #fbfaff;
  padding: 10px;
}

.preview-actions button {
  min-height: 46px;
  flex-direction: column;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.preview-actions button:hover,
.preview-actions button[aria-pressed="true"] {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}

.toast {
  border: 1px solid rgba(216, 210, 231, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  color: var(--text);
  padding: 12px 14px;
  animation: toast-in 180ms ease-out;
}

.hidden-by-search {
  display: none !important;
}

.mobile-only {
  display: none;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 18;
  background: rgba(23, 22, 36, 0.42);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .preview-sticky {
    position: static;
  }

  .phone-frame {
    width: min(100%, 420px);
  }
}

@media (max-width: 980px) {
  .mobile-only {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    left: 0;
    transform: translateX(-106%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .topbar {
    padding: 12px 18px;
  }

  .topbar-title {
    min-width: 0;
  }

  .vk-button {
    display: none;
  }

  .hero-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body {
    background: var(--bg);
  }

  .topbar {
    gap: 8px;
  }

  .topbar-title span {
    display: none;
  }

  .topbar-title strong {
    font-size: 15px;
  }

  .topbar {
    flex-wrap: wrap;
    min-height: 64px;
  }

  .topbar-spacer {
    min-width: 0;
  }

  .content-grid {
    gap: 18px;
    padding: 16px;
  }

  .bottom-events {
    margin-bottom: 18px;
    padding: 0 16px;
  }

  .hero-card,
  .panel {
    border-radius: 22px;
    padding: 18px;
  }

  .hero-stats {
    gap: 8px;
  }

  .hero-stats div {
    flex-basis: calc(50% - 4px);
    gap: 8px;
    padding: 12px 10px;
  }

  .hero-stats span {
    font-size: 12px;
  }

  .platform-row {
    gap: 8px;
  }

  .platform-chip {
    min-height: 40px;
    padding: 8px 12px;
  }

  .integration-grid,
  .vk-token-grid,
  .attachment-fields {
    grid-template-columns: 1fr;
  }

  .access-panel summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .access-panel summary::after {
    grid-column: 2;
    justify-self: end;
  }

  .events-toggle {
    align-items: flex-start;
  }

  .editor-toolbar {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .editor-toolbar::-webkit-scrollbar {
    display: none;
  }

  .panel-heading,
  .action-row,
  .media-card {
    align-items: stretch;
    flex-direction: column;
  }

  .schedule-grid {
    grid-template-columns: 1fr;
  }

  .action-row .primary-action,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .result-item {
    align-items: stretch;
    flex-direction: column;
  }

  .phone-frame {
    min-height: 580px;
    border-width: 8px;
    border-radius: 30px;
  }

  .preview-body {
    min-height: 410px;
  }
}

@media (max-width: 380px) {
  .content-grid {
    padding: 12px;
  }

  .hero-card,
  .panel {
    padding: 14px;
  }

  .hero-stats div {
    flex-basis: 100%;
    justify-content: space-between;
  }

  .media-copy > .material-symbols-outlined {
    width: 42px;
    height: 42px;
  }

  .preview-actions {
    padding: 8px;
  }

  .preview-actions button {
    min-height: 42px;
    border-radius: 12px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
