@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;700;800&family=Unbounded:wght@600;700&display=swap");

:root {
  --bg: #090a10;
  --bg-soft: #050508;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-strong: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(168, 85, 247, 0.58);
  --text: #ffffff;
  --muted: #d0d5e8;
  --muted-strong: #f6f7ff;
  --accent: #5e67ff;
  --accent-strong: #9b53ff;
  --accent-soft: rgba(94, 103, 255, 0.32);
  --accent-glow: rgba(155, 83, 255, 0.58);
  --accent-sky: #9ed2ff;
  --success: #00ff88;
  --danger: #ff7d91;
  --shadow: 0 40px 140px rgba(0, 0, 0, 0.82);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --container: 1220px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  min-height: 100%;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 16% 14%, rgba(94, 103, 255, 0.2), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(155, 83, 255, 0.3), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(72, 22, 118, 0.26), transparent 40%),
    linear-gradient(180deg, #090a10 0%, #10121d 34%, #0b0b12 68%, #050508 100%);
  overflow-x: hidden;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
  max-width: 100%;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}

button {
  border: 0;
}

.ambient {
  position: fixed;
  width: 36vw;
  height: 36vw;
  border-radius: 999px;
  filter: blur(110px);
  pointer-events: none;
  opacity: 0.4;
  z-index: 0;
}

.ambient-a {
  top: -10vw;
  left: -8vw;
  background: rgba(99, 102, 241, 0.22);
}

.ambient-b {
  right: -8vw;
  bottom: -10vw;
  background: rgba(168, 85, 247, 0.26);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(24px + env(safe-area-inset-top, 0px))
    calc(18px + env(safe-area-inset-right, 0px))
    calc(24px + env(safe-area-inset-bottom, 0px))
    calc(18px + env(safe-area-inset-left, 0px));
  background: rgba(5, 8, 16, 0.72);
  backdrop-filter: blur(16px) saturate(135%);
}

.loading-overlay-card {
  min-width: 168px;
  max-width: min(92vw, 320px);
  padding: 24px 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02)),
    rgba(8, 12, 24, 0.92);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.48);
  text-align: center;
}

.loading-overlay-card p {
  margin: 14px 0 0;
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 700;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent-sky);
  border-right-color: var(--accent-strong);
  animation: loading-spin 0.9s linear infinite;
}

@keyframes loading-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(var(--container), 100%);
  max-width: 100%;
  overflow-x: clip;
  margin: 0 auto;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    max(14px, env(safe-area-inset-right, 0px))
    calc(64px + env(safe-area-inset-bottom, 0px))
    max(14px, env(safe-area-inset-left, 0px));
}

.topbar,
.hero,
.menu-shell,
.panel,
.subpanel,
.screen {
  position: relative;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015)),
    linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2) 58%, rgba(255, 255, 255, 0.012)),
    rgba(6, 6, 14, 0.92);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: var(--shadow);
}

.topbar::before,
.hero::before,
.menu-shell::before,
.panel::before,
.subpanel::before,
.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(168, 85, 247, 0.08), transparent 36%);
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
  padding: 18px 24px;
  border-radius: 999px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
}

.brand-mark-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  visibility: hidden;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(145deg, #287cc1, #934ce5);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brand-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-mark.is-fallback .brand-mark-fallback {
  visibility: visible;
}

.brand-mark.is-fallback img,
.brand-mark img[hidden] {
  display: none;
}

.site-nav {
  display: none;
}

.nav-link,
.menu-tab,
.button,
.hub-card,
.link-tile {
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.nav-link {
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
}

.nav-link:hover,
.nav-link:focus-visible,
.menu-tab:hover,
.button:hover,
.hub-card:hover,
.link-tile:hover {
  transform: translateY(-1px);
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.hero {
  margin-top: 34px;
  padding: 38px;
  border-radius: var(--radius-xl);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.95fr);
  gap: 30px;
}

body[data-active-screen="content-plan"] .hero {
  display: none;
}

.eyebrow,
.section-kicker,
.summary-kicker,
.stat-label,
.bridge-service {
  display: inline-block;
  color: #c7b0ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.section-head h2,
.panel h3 {
  margin: 0;
  font-family: "Unbounded", "Manrope", sans-serif;
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.hero h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.hero-lede,
.section-copy,
.compact-empty,
.about-subtitle,
.plan-summary,
.plan-description,
.faq-item p,
.empty-card p {
  color: var(--muted);
  line-height: 1.65;
}

.section-actions,
.section-head,
.panel-head,
.sync-grid,
.subscription-layout,
.help-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill,
.tariff-pill,
.promo-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
}

.hero-metric,
.stat-card,
.summary-card,
.bridge-card,
.plan-card,
.job-card,
.compact-item,
.empty-card,
.subpanel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-lg);
}

.hero-metric {
  min-height: 168px;
  padding: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.016)),
    linear-gradient(180deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.12)),
    rgba(6, 6, 14, 0.88);
}

.hero-metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.hero-metric strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(26px, 4vw, 42px);
}

.hero-quota-card {
  display: grid;
  align-content: start;
  gap: 18px;
}

.hero-quota-title {
  color: var(--muted-strong) !important;
  font-weight: 700;
}

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

.hero-quota-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(5, 5, 12, 0.34);
}

.hero-quota-item strong {
  margin-top: 8px;
  font-size: clamp(24px, 3.4vw, 34px);
  white-space: nowrap;
}

.sync-state-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(0, 255, 136, 0.26);
  background:
    linear-gradient(135deg, rgba(0, 255, 136, 0.18), rgba(94, 103, 255, 0.12)),
    rgba(7, 8, 12, 0.76);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.sync-state-toggle.is-paused {
  border-color: rgba(255, 125, 145, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 125, 145, 0.18), rgba(168, 85, 247, 0.1)),
    rgba(7, 8, 12, 0.76);
}

.sync-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(0, 255, 136, 0.16);
}

.sync-state-toggle.is-paused .sync-state-icon {
  background: rgba(255, 125, 145, 0.16);
}

.sync-state-copy {
  display: grid;
  gap: 3px;
}

.sync-state-copy strong {
  font-size: 14px;
  line-height: 1.25;
}

.menu-shell {
  margin-top: 22px;
  padding: 10px;
  border-radius: 34px;
}

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

.menu-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 22px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-weight: 800;
}

.menu-tab.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.34), rgba(168, 85, 247, 0.32));
  border-color: var(--line-strong);
  color: var(--text);
  box-shadow: 0 18px 40px rgba(88, 87, 255, 0.22);
}

.menu-tab-icon {
  font-size: 16px;
}

.global-status {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: max-content;
  max-width: min(420px, calc(100vw - 32px));
  min-height: 0;
  margin: 0;
  padding: 12px 16px;
  border: 1px solid rgba(0, 255, 136, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0, 255, 136, 0.16), rgba(155, 83, 255, 0.18)),
    rgba(8, 12, 24, 0.94);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.42), 0 0 34px rgba(0, 255, 136, 0.16);
  color: #ddffef;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.global-status::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 255, 136, 0.16);
  color: var(--success);
  font-weight: 800;
}

.global-status.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.global-status.is-error {
  border-color: rgba(255, 125, 145, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 125, 145, 0.16), rgba(155, 83, 255, 0.16)),
    rgba(8, 12, 24, 0.96);
  color: #ffd7de;
}

.global-status.is-error::before {
  content: "!";
  background: rgba(255, 125, 145, 0.16);
  color: var(--danger);
}

.screen {
  display: none;
  margin-top: 30px;
  padding: 36px;
  border-radius: var(--radius-xl);
}

.screen.is-active {
  display: block;
}

.section-head {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
}

.panel-head {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
}

.section-head > div,
.panel-head > div {
  display: grid;
  gap: 12px;
}

.section-copy {
  margin-top: 18px;
  max-width: 920px;
}

.section-copy,
.field-note,
.bridge-endpoint-copy p,
.hub-card small,
.toggle-card small,
.faq-item p,
.activity-card p,
.about-subtitle {
  overflow-wrap: anywhere;
}

.panel {
  margin-top: 28px;
  padding: 30px;
  border-radius: var(--radius-lg);
}

.panel-compact-footer {
  padding-bottom: 22px;
}

.subpanel {
  padding: 24px;
}

body.vk-community-miniapp-mode .topbar,
body.vk-community-miniapp-mode .hero,
body.vk-community-miniapp-mode .menu-shell,
body.vk-community-miniapp-mode .sync-hub,
body.vk-community-miniapp-mode #sync-create > .panel-head,
body.vk-community-miniapp-mode .section-head,
body.vk-community-miniapp-mode .screen[data-screen="sync"] > .section-copy,
body.vk-community-miniapp-mode #sync-create > .section-copy,
body.vk-community-miniapp-mode #bridge-create-form > .bridge-flow-step,
body.vk-community-miniapp-mode #bridge-route-status,
body.vk-community-miniapp-mode .bridge-endpoint-tg,
body.vk-community-miniapp-mode .bridge-endpoint-max,
body.vk-community-miniapp-mode .bridge-endpoint-telegram,
body.vk-community-miniapp-mode .vk-community-source-field,
body.vk-community-miniapp-mode .bridge-form-panel:not([data-bridge-panel="vk"]),
body.vk-community-miniapp-mode .bridge-endpoint-copy,
body.vk-community-miniapp-mode #bridge-create-submit,
body.vk-community-miniapp-mode #bridge-create-status,
body.vk-community-miniapp-mode #sync-bridges,
body.vk-community-miniapp-mode #sync-comments-admin,
body.vk-community-miniapp-mode #sync-migration {
  display: none !important;
}

body.vk-community-miniapp-mode .page-shell {
  width: min(560px, 100%);
  padding-top: max(12px, env(safe-area-inset-top, 0px));
}

body.vk-community-miniapp-mode .screen[data-screen="sync"] {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.vk-community-miniapp-mode #sync-create {
  margin-top: 0;
}

body.vk-community-miniapp-mode .bridge-form-panel[data-bridge-panel="vk"].is-active,
body.vk-community-miniapp-mode .bridge-endpoint-vk {
  display: grid;
  grid-template-columns: 1fr;
}

body.vk-community-miniapp-mode .bridge-endpoint-vk {
  padding: 24px;
}

body.vk-community-miniapp-mode #vk-community-miniapp-panel {
  display: grid !important;
  gap: 16px;
}

body.vk-community-miniapp-mode #vk-community-miniapp-panel > span {
  color: var(--accent-sky);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.vk-community-miniapp-mode #vk-community-miniapp-panel .section-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  white-space: normal;
  line-height: 1.3;
  text-align: center;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 18px 44px rgba(115, 88, 255, 0.34);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--line);
}

.button-inline {
  min-height: 44px;
  padding: 0 16px;
}

.button-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--muted-strong);
}

.button-danger {
  min-height: 40px;
  padding: 0 14px;
  background: rgba(255, 125, 145, 0.12);
  border-color: rgba(255, 125, 145, 0.28);
  color: #ffd3da;
}

.button:disabled {
  opacity: 0.56;
  cursor: default;
  transform: none;
}

.sync-hub {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 168px;
  padding: 22px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(99, 102, 241, 0.18), rgba(168, 85, 247, 0.14)),
    rgba(7, 8, 12, 0.74);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.hub-card strong {
  font-size: 18px;
}

.hub-card small {
  color: var(--muted);
  line-height: 1.5;
}

.hub-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.34), rgba(168, 85, 247, 0.28));
  font-size: 20px;
}

.segmented-control {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: min(100%, 520px);
  margin-top: 22px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.segmented-control::-webkit-scrollbar {
  display: none;
}

.segment {
  flex: 1 0 128px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

#bridge-source-switch .segment,
#vk-target-kind-switch .segment {
  flex-basis: 0;
}

.segment.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(168, 85, 247, 0.28));
  color: var(--text);
}

.form-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.field,
.toggle-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.016)),
    linear-gradient(135deg, rgba(94, 103, 255, 0.12), rgba(155, 83, 255, 0.12)),
    rgba(11, 9, 23, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.field,
.toggle-card,
.hero-metric,
.fact-card,
.selector-empty,
.activity-card,
.bridge-card,
.plan-card,
.summary-card,
.job-card,
.compact-item,
.empty-card,
.hub-card,
.bridge-endpoint {
  min-width: 0;
}

.section-actions {
  margin-top: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
}

.field span {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select,
.rule-scope-field select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(5, 5, 11, 0.98);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

.field select,
.rule-scope-field select {
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.78) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.field select:disabled,
.rule-scope-field select:disabled {
  opacity: 1;
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.16);
  background-color: rgba(5, 5, 11, 0.98);
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.rule-scope-field select:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(155, 83, 255, 0.22);
}

.field-wide,
.bridge-form-panel,
.bridge-flow-step,
.migration-form .compact-toggle {
  grid-column: 1 / -1;
}

.settings-rules-card {
  gap: 16px;
}

.settings-section {
  display: grid;
  gap: 18px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    rgba(8, 7, 18, 0.74);
}

.settings-section-head {
  display: grid;
  gap: 6px;
}

.settings-section-head h3 {
  margin: 0;
  font-size: 20px;
}

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

.settings-section-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

.team-access-card {
  display: grid;
  gap: 10px;
}

.team-members-list {
  display: grid;
  gap: 8px;
}

.team-invite-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.team-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.team-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.team-member-link {
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.team-member-remove {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
}

.team-member-remove:hover {
  color: var(--danger);
}

.settings-save-button {
  min-height: 40px;
  padding: 0 16px;
  font-size: 13px;
}

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

.settings-summary-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.045);
}

.content-plan-head,
.content-plan-shell,
.content-plan-toolbar,
.content-plan-filters,
.content-plan-card,
.content-plan-card-top,
.content-plan-card-meta,
.content-plan-card-actions,
.content-plan-composer-actions,
.content-plan-time-grid {
  display: grid;
  min-width: 0;
}

.content-plan-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
}

.content-plan-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.content-plan-shell {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 20px;
  margin-top: 28px;
  align-items: start;
}

body.is-content-plan-composer-hidden .content-plan-shell {
  grid-template-columns: 1fr;
}

body.is-content-plan-composer-hidden .content-plan-composer {
  display: none;
}

.content-plan-board,
.content-plan-composer {
  min-width: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.018)),
    rgba(8, 9, 18, 0.74);
}

.content-plan-board {
  padding: 20px;
}

.content-plan-composer {
  position: sticky;
  top: 18px;
  padding: 16px;
}

.content-plan-toolbar {
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: end;
}

.content-plan-view-switch {
  width: 100%;
  margin-top: 0;
}

.content-plan-view-switch .segment {
  flex-basis: 0;
}

.content-plan-period-nav {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.content-plan-period-nav strong {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  color: var(--muted-strong);
  text-align: center;
  font-size: 15px;
}

.content-plan-period-nav #content-plan-today {
  grid-column: 1 / -1;
  width: 100%;
  justify-content: center;
}

.content-plan-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.content-plan-filters {
  grid-template-columns: minmax(130px, 0.75fr) minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 10px;
}

.content-plan-filter-button,
.content-plan-sheet-close,
.content-plan-sheet-backdrop {
  display: none;
}

.compact-field {
  display: grid;
  gap: 6px;
}

.compact-field span,
.content-plan-preview > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.compact-field input,
.compact-field select {
  width: 100%;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(5, 5, 11, 0.98);
  color: var(--text);
  padding: 10px 12px;
}

.content-plan-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.content-plan-metric {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(255,255,255,0.045);
}

.content-plan-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.content-plan-metric strong {
  font-size: 24px;
}

.content-plan-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.calendar-grid,
.calendar-week-grid,
.calendar-day-grid {
  min-width: 0;
}

.calendar-grid-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(6, 8, 14, 0.72);
}

.calendar-weekday {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid rgba(255,255,255,0.1);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-month-cell {
  min-height: 124px;
  padding: 8px;
  border-right: 1px solid rgba(255,255,255,0.09);
  border-bottom: 1px solid rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.018);
}

.calendar-month-cell.is-muted {
  opacity: 0.45;
}

.calendar-month-cell.is-today .calendar-cell-date,
.calendar-week-day.is-today header strong {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.calendar-cell-date {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
}

.calendar-cell-posts,
.calendar-week-stack,
.calendar-hour-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.calendar-cell-posts {
  margin-top: 6px;
}

.calendar-post-pill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(94, 103, 255, 0.22);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.calendar-post-pill.is-compact {
  grid-template-columns: 1fr;
  gap: 1px;
}

.calendar-post-pill.is-published {
  background: rgba(0, 255, 136, 0.13);
}

.calendar-post-pill.is-failed {
  background: rgba(255, 125, 145, 0.16);
}

.calendar-post-pill.is-draft {
  background: rgba(255,255,255,0.08);
}

.calendar-post-pill span,
.calendar-post-pill strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.calendar-post-pill span {
  color: var(--accent-sky);
  font-weight: 900;
}

.calendar-more,
.calendar-empty-slot {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-week-day {
  min-height: 360px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.13);
  background: rgba(6, 8, 14, 0.72);
}

.calendar-week-day header {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin-bottom: 10px;
}

.calendar-week-day header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-week-day header strong {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.calendar-day-grid {
  display: grid;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(6, 8, 14, 0.72);
}

.calendar-hour-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  min-height: 54px;
  border-bottom: 1px solid rgba(255,255,255,0.09);
}

.calendar-hour-row time {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  border-right: 1px solid rgba(255,255,255,0.09);
}

.calendar-hour-body {
  padding: 8px;
}

.mobile-agenda,
.mobile-week-accordion,
.mobile-month {
  display: grid;
  gap: 10px;
}

.mobile-agenda-toggle,
.mobile-empty-create,
.mobile-week-day > button,
.mobile-month-day,
.mobile-post-card > button,
.mobile-post-retry {
  font: inherit;
}

.mobile-agenda-toggle,
.mobile-empty-create {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  color: var(--muted-strong);
  font-weight: 900;
}

.mobile-agenda-slot {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.mobile-agenda-slot time {
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.mobile-agenda-slot > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.mobile-post-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 16px;
  background: rgba(255,255,255,0.045);
  overflow: hidden;
}

.mobile-post-card.is-published {
  border-color: rgba(0, 255, 136, 0.24);
}

.mobile-post-card.is-failed {
  border-color: rgba(255, 125, 145, 0.34);
}

.mobile-post-card > button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px 10px;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.mobile-post-card span {
  color: var(--accent-sky);
  font-size: 12px;
  font-weight: 900;
}

.mobile-post-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}

.mobile-post-card em {
  justify-self: end;
  color: var(--muted-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-post-card small {
  grid-column: 2 / -1;
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.mobile-post-retry {
  min-height: 38px;
  margin: 0 12px 12px;
  border: 1px solid rgba(255, 125, 145, 0.32);
  border-radius: 14px;
  background: rgba(255, 125, 145, 0.11);
  color: #ffdce3;
  font-weight: 900;
}

.mobile-week-day {
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 18px;
  background: rgba(6, 8, 14, 0.72);
  overflow: hidden;
}

.mobile-week-day > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.mobile-week-day > button span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.mobile-week-day > button strong {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.mobile-week-day-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.mobile-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.mobile-month-weekday {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-month-day {
  display: grid;
  place-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 46px;
  padding: 5px 2px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 13px;
  background: rgba(255,255,255,0.035);
  color: var(--text);
}

.mobile-month-day.is-muted {
  opacity: 0.38;
}

.mobile-month-day.is-today strong,
.mobile-month-day.is-selected strong {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
}

.mobile-month-day.is-selected {
  border-color: rgba(141, 113, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(141, 113, 255, 0.25);
}

.mobile-month-day strong {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
}

.mobile-month-day span {
  display: flex;
  gap: 3px;
  min-height: 5px;
}

.mobile-month-day i {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.34);
}

.mobile-month-day i.is-scheduled {
  background: var(--accent-sky);
}

.mobile-month-day i.is-published {
  background: var(--success);
}

.mobile-month-day i.is-failed {
  background: var(--danger);
}

.mobile-month-panel {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 18px;
  background: rgba(6, 8, 14, 0.72);
}

.mobile-month-panel header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-strong);
}

.content-plan-card {
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    linear-gradient(135deg, rgba(24, 172, 131, 0.08), rgba(94, 103, 255, 0.12)),
    rgba(7, 8, 14, 0.82);
}

.content-plan-card.is-failed {
  border-color: rgba(255, 125, 145, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 125, 145, 0.12), rgba(94, 103, 255, 0.08)),
    rgba(7, 8, 14, 0.82);
}

.content-plan-card.is-published {
  border-color: rgba(0, 255, 136, 0.26);
}

.content-plan-card-time {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
  color: var(--accent-sky);
  font-size: 14px;
  font-weight: 900;
}

.content-plan-card-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.content-plan-card-top {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.content-plan-card-top strong {
  overflow-wrap: anywhere;
}

.content-plan-card-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.content-plan-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.content-plan-status.is-scheduled {
  color: #cfd8ff;
  background: rgba(94, 103, 255, 0.22);
}

.content-plan-status.is-published {
  color: #c9ffdf;
  background: rgba(0, 255, 136, 0.13);
}

.content-plan-status.is-failed {
  color: #ffd7de;
  background: rgba(255, 125, 145, 0.16);
}

.content-plan-card-meta,
.content-plan-card-actions {
  grid-template-columns: repeat(2, minmax(0, auto));
  justify-content: start;
  gap: 8px;
}

.content-plan-card-meta span,
.content-plan-route-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--muted-strong);
  background: rgba(255,255,255,0.045);
  font-size: 12px;
  font-weight: 800;
}

.content-plan-error {
  color: #ffd7de !important;
}

.content-plan-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-plan-links a {
  color: var(--accent-sky);
  font-weight: 800;
}

.content-plan-form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.content-plan-composer-head {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.content-plan-composer-head h3 {
  margin: 0;
}

.content-plan-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.content-plan-media-field {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(10, 10, 18, 0.5);
}

.content-plan-media-head {
  display: grid;
  gap: 4px;
}

.content-plan-media-head span {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.content-plan-media-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.content-plan-media-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.content-plan-media-button,
.content-plan-format-toolbar button,
.content-plan-selection-menu button,
.content-plan-media-chip {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.content-plan-media-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 900;
}

.content-plan-media-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.content-plan-media-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.content-plan-media-chip {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  max-width: 100%;
  gap: 8px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 999px;
  text-align: left;
}

.content-plan-media-chip span,
.content-plan-media-chip small {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 900;
}

.content-plan-media-chip strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-plan-format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-plan-format-toolbar button,
.content-plan-selection-menu button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.content-plan-selection-menu {
  position: sticky;
  bottom: 8px;
  z-index: 4;
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 14, 24, 0.96);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.content-plan-selection-menu[hidden] {
  display: none;
}

.content-plan-text-editor {
  min-height: 220px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 5, 11, 0.98);
  color: var(--text);
  font-size: 15px;
  outline: none;
  line-height: 1.44;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.content-plan-text-editor:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(155, 83, 255, 0.22);
}

.content-plan-text-editor.is-empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.content-plan-text-editor a,
.telegram-post-text a {
  color: #6bc7ff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.content-plan-rules-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.content-plan-rules-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.content-plan-rules-toggle span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.content-plan-rules-toggle strong {
  color: var(--text);
  font-size: 14px;
}

.content-plan-rules-toggle small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.content-plan-rules-toggle input {
  width: 22px;
  height: 22px;
}

.content-plan-rules-tags {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-plan-rules-tags:empty {
  display: none;
}

.content-plan-rules-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 900;
}

.content-plan-time-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.route-picker {
  display: grid;
  gap: 8px;
}

.content-plan-channel-select-label {
  display: grid;
  gap: 8px;
}

.content-plan-channel-select-label span,
.content-plan-channel-select-label small {
  font-weight: 900;
}

.content-plan-channel-select-label span {
  color: var(--text);
}

.content-plan-channel-select-label small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.content-plan-channel-select-label select {
  width: 100%;
  min-height: 50px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.34);
  color: var(--text);
  font: inherit;
  font-weight: 900;
  padding: 0 42px 0 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.content-plan-channel-select-label select:focus {
  border-color: rgba(151,84,255,0.78);
  box-shadow: 0 0 0 3px rgba(151,84,255,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}

.route-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.035);
  cursor: pointer;
}

.route-option input {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.24);
}

.route-option input:checked {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.route-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.route-option strong,
.route-option small {
  overflow-wrap: anywhere;
}

.route-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.content-plan-preview {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(158, 210, 255, 0.22);
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 12%, rgba(98, 141, 174, 0.24) 0 1px, transparent 2px),
    radial-gradient(circle at 76% 20%, rgba(98, 141, 174, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 36% 78%, rgba(98, 141, 174, 0.16) 0 1px, transparent 2px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='132' height='132' viewBox='0 0 132 132'%3E%3Cg fill='none' stroke='%236f91aa' stroke-opacity='.18' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 28c10-12 24-12 33 0M84 23c12 0 21 8 21 20M30 74c5-12 18-18 31-13M93 82c11 5 17 14 16 25M19 111c14-2 24 2 31 12M72 108c5-11 17-16 29-12'/%3E%3Ccircle cx='23' cy='51' r='5'/%3E%3Ccircle cx='112' cy='61' r='4'/%3E%3Cpath d='M65 22l8 8-8 8-8-8zM47 91l7 7-7 7-7-7zM101 30l8 2-5 7z'/%3E%3Cpath d='M8 88h16M74 62h19M111 116h12'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(160deg, #11283b 0%, #17344b 48%, #10293f 100%);
  background-size: 88px 88px, 124px 124px, 96px 96px, 132px 132px, auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(68, 132, 178, 0.22),
    0 24px 70px rgba(0, 0, 0, 0.28);
}

.content-plan-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(78, 154, 206, 0.22), transparent 34%),
    radial-gradient(circle at 12% 92%, rgba(38, 94, 132, 0.3), transparent 44%);
  mix-blend-mode: screen;
  opacity: 0.72;
}

.content-plan-preview > * {
  position: relative;
  z-index: 1;
}

.telegram-post-preview {
  position: relative;
  display: grid;
  gap: 7px;
  width: min(100%, 460px);
  margin-right: 36px;
  padding: 10px 10px 9px;
  border-radius: 17px 17px 17px 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0)),
    #182c3d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 2px 1px rgba(0, 0, 0, 0.28),
    0 18px 38px rgba(0, 0, 0, 0.26);
}

.telegram-post-preview::before {
  content: "";
  position: absolute;
  left: -1px;
  bottom: -1px;
  width: 13px;
  height: 13px;
  border-bottom-left-radius: 5px;
  background: #182c3d;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
  filter: drop-shadow(-1px 1px 0 rgba(0, 0, 0, 0.18));
}

.telegram-post-author {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: #7bc7ff;
}

.telegram-post-author span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #37aee2, #229ed9);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.telegram-post-author strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-post-media {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  overflow: hidden;
  border-radius: 12px;
  width: 100%;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 10px 22px rgba(0, 0, 0, 0.18);
}

.telegram-post-media:has(figure:nth-child(2)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.telegram-post-media.is-empty {
  display: none;
}

.telegram-post-media figure {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 120px;
  max-height: 360px;
  aspect-ratio: 16 / 10;
  margin: 0;
  overflow: hidden;
  background: #0d1822;
}

.telegram-post-media img,
.telegram-post-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.telegram-post-media.is-empty + .telegram-post-text {
  padding-top: 0;
}

.telegram-post-media figure:only-child {
  aspect-ratio: 16 / 9;
}

.telegram-post-media figure:has(img):only-child {
  aspect-ratio: auto;
}

.telegram-post-media figure:has(img):only-child img {
  height: auto;
  max-height: 420px;
  object-fit: contain;
  background: #0d1822;
}

.telegram-post-media figure.is-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.telegram-post-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(6px);
}

.telegram-post-play::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 19px solid rgba(255, 255, 255, 0.95);
}

.telegram-post-file {
  align-content: center;
  gap: 4px;
  padding: 12px;
}

.telegram-post-file span {
  font-size: 12px;
  color: #8ccfff;
  font-weight: 900;
}

.telegram-post-file strong,
.telegram-post-file small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-post-file small {
  color: var(--muted);
}

.telegram-post-text {
  margin: 0;
  padding: 2px 2px 0;
  color: #f4f8ff;
  font-size: 15px;
  line-height: 1.44;
  overflow-wrap: anywhere;
  white-space: normal;
}

.telegram-post-text p {
  margin: 0 0 11px;
}

.telegram-post-text p:last-child {
  margin-bottom: 0;
}

.telegram-post-text b,
.telegram-post-text strong {
  font-weight: 900;
}

.telegram-post-text i,
.telegram-post-text em {
  font-style: italic;
}

.telegram-post-text.is-empty {
  color: rgba(244, 248, 255, 0.58);
}

.telegram-post-reactions,
.telegram-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.telegram-post-reactions span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(87, 137, 177, 0.34);
  color: #66c4ff;
  font-size: 13px;
  font-weight: 800;
}

.telegram-post-meta {
  justify-content: flex-end;
  color: #b7c4d4;
  font-size: 13px;
  font-weight: 700;
}

.telegram-post-share {
  position: absolute;
  right: -42px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(45, 164, 255, 0.18);
  color: #32aaff;
  font-size: 22px;
  font-weight: 900;
}

.content-plan-route-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.content-plan-preview > .content-plan-route-chips {
  max-width: min(100%, 430px);
  margin-right: 36px;
}

.content-plan-composer-actions {
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.settings-summary-card strong {
  font-size: 15px;
}

.settings-summary-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.premium-lock-note {
  margin: 2px 0 0;
  color: #f8b65a;
  font-size: 12px;
  font-style: italic;
  line-height: 1.45;
}

.settings-action-card {
  min-height: 96px;
  align-items: center;
}

.settings-scoped-toggle-card {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.settings-scoped-toggle-card .settings-toggle-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.setting-scope-field {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-action-card .button {
  width: auto;
}

.settings-vk-auth-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.vk-auth-reset-modal > p {
  color: var(--muted-strong);
  line-height: 1.55;
}

.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.modal-actions .button {
  width: 100%;
}

.comments-bot-launch-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 16px;
}

.comments-bot-launch-card .button {
  width: 100%;
}

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

.rule-scope-field {
  display: grid;
  gap: 8px;
}

.rule-scope-field > span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.selected-scope-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.selected-scope-chips:empty {
  display: none;
}

.scope-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.scope-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--muted-strong);
  flex: 0 0 auto;
}

.bridge-form-panel {
  display: none;
}

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

.bridge-flow-step {
  display: grid;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014)),
    rgba(5, 5, 11, 0.54);
}

.flow-step-kicker {
  margin: 0;
  color: var(--accent-sky);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.route-status.is-error {
  color: var(--danger);
}

.bridge-endpoint {
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(168, 85, 247, 0.13)),
    rgba(7, 7, 15, 0.84);
}

.bridge-endpoint-copy {
  display: grid;
  gap: 8px;
}

.bridge-endpoint-copy h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.bridge-endpoint-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.vk-auth-actions {
  display: grid;
  gap: 12px;
}

.field-note {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.6;
}

.selector-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.text-action {
  align-self: flex-start;
  border: 0;
  background: transparent;
  color: var(--accent-sky);
  padding: 2px 0;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.text-action:focus-visible {
  outline: 2px solid var(--accent-sky);
  outline-offset: 3px;
  border-radius: 6px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(10px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(12, 12, 22, 0.98);
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal-card h3 {
  margin: 0;
  font-size: 19px;
}

.modal-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--muted-strong);
  line-height: 1.55;
}

.field-note code {
  color: var(--accent-sky);
}

.vk-connect-progress {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(26, 115, 232, 0.26);
  border-radius: 8px;
  background: rgba(26, 115, 232, 0.08);
}

.vk-connect-progress[hidden] {
  display: none;
}

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

.vk-connect-progress-head strong {
  min-width: 0;
  font-size: 15px;
  line-height: 1.25;
}

.vk-connect-progress p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.45;
}

.vk-connect-progress-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(26, 115, 232, 0.16);
  color: #174ea6;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.vk-connect-progress[data-severity="success"] {
  border-color: rgba(19, 115, 51, 0.28);
  background: rgba(19, 115, 51, 0.08);
}

.vk-connect-progress[data-severity="success"] .vk-connect-progress-badge {
  background: rgba(19, 115, 51, 0.14);
  color: #0d652d;
}

.vk-connect-progress[data-severity="warning"] {
  border-color: rgba(178, 94, 0, 0.32);
  background: rgba(178, 94, 0, 0.08);
}

.vk-connect-progress[data-severity="warning"] .vk-connect-progress-badge {
  background: rgba(178, 94, 0, 0.14);
  color: #8a4b00;
}

.vk-connect-progress[data-severity="error"] {
  border-color: rgba(179, 38, 30, 0.3);
  background: rgba(179, 38, 30, 0.08);
}

.vk-connect-progress[data-severity="error"] .vk-connect-progress-badge {
  background: rgba(179, 38, 30, 0.14);
  color: #9f1c15;
}

.vk-connect-progress-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.vk-connect-progress-step {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.vk-connect-progress-dot {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.38);
}

.vk-connect-progress-step[data-status="done"] {
  color: #0d652d;
}

.vk-connect-progress-step[data-status="done"] .vk-connect-progress-dot {
  background: #2e7d32;
}

.vk-connect-progress-step[data-status="active"] {
  color: #174ea6;
  font-weight: 700;
}

.vk-connect-progress-step[data-status="active"] .vk-connect-progress-dot {
  background: #1a73e8;
}

.vk-connect-progress-step[data-status="error"] {
  color: #9f1c15;
  font-weight: 700;
}

.vk-connect-progress-step[data-status="error"] .vk-connect-progress-dot {
  background: #d93025;
}

.vk-connect-status-toast {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(100%, 280px);
  padding: 9px 14px;
  border: 1px solid rgba(6, 95, 70, 0.45);
  border-radius: 8px;
  background: rgba(6, 78, 59, 0.94);
  color: #ecfdf5;
  box-shadow: 0 12px 30px rgba(5, 10, 20, 0.28);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.vk-connect-status-toast[hidden] {
  display: none;
}

.vk-connect-status-toast[data-kind="info"] {
  border-color: rgba(30, 64, 175, 0.45);
  background: rgba(30, 64, 175, 0.94);
}

.vk-connect-status-toast[data-kind="warning"] {
  border-color: rgba(146, 64, 14, 0.45);
  background: rgba(146, 64, 14, 0.94);
}

.vk-connect-status-toast[data-kind="error"] {
  border-color: rgba(153, 27, 27, 0.45);
  background: rgba(153, 27, 27, 0.94);
}

.vk-connect-status-toast-icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.vk-connect-status-toast.is-spinning .vk-connect-status-toast-icon {
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-top-color: #fff;
  background: transparent;
  animation: vkStatusToastSpin 0.8s linear infinite;
}

@keyframes vkStatusToastSpin {
  to {
    transform: rotate(360deg);
  }
}

.vk-connect-remote {
  display: grid;
  gap: 0;
  margin: 18px 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: rgba(5, 5, 11, 0.96);
}

/* Browser chrome header */
.vk-browser-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 10px;
  background: #171b24;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.vk-browser-chrome-dots {
  display: none;
}

.vk-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.vk-dot-red    { background: #ff5f57; }
.vk-dot-yellow { background: #febc2e; }
.vk-dot-green  { background: #28c840; }

.vk-browser-address-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 34px;
  padding: 4px 11px;
  border-radius: 6px;
  background: #0e1118;
  font-size: 12px;
  color: var(--muted-strong);
  overflow: hidden;
}

.vk-browser-address-bar #vk-browser-address-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vk-browser-lock {
  display: block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #2ecb82;
  box-shadow: 0 0 0 3px rgba(46, 203, 130, 0.12);
}

.vk-browser-connection-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-strong);
  font-size: 11px;
  white-space: nowrap;
}

.vk-browser-connection-state > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ecb82;
}

.vk-browser-connection-state.is-busy > span:first-child {
  background: #f1c75b;
}

.vk-browser-connection-state.is-error {
  color: #ff9caa;
}

.vk-browser-connection-state.is-error > span:first-child {
  background: #ff657a;
}

.vk-browser-reload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted-strong);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.vk-browser-reload-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Screenshot stage */
.vk-connect-remote-stage {
  position: relative;
  overflow: hidden;
  height: clamp(560px, 72vh, 820px);
  background: rgba(5, 5, 11, 0.96);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  touch-action: manipulation;
}

.vk-connect-remote-stage.is-live {
  border-color: rgba(118, 95, 255, 0.28);
  box-shadow: 0 14px 38px rgba(8, 8, 16, 0.28);
}

.vk-connect-remote-stage.is-busy {
  border-color: rgba(255, 214, 122, 0.28);
  box-shadow: 0 16px 42px rgba(255, 214, 122, 0.09);
}

.vk-connect-remote-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  cursor: pointer;
  image-rendering: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-drag: none;
}

.vk-connect-touch-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  z-index: 2;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 7px 10px;
  border-radius: 6px;
  background: rgba(10, 13, 20, 0.86);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.vk-connect-remote-stage.has-interacted .vk-connect-touch-hint {
  opacity: 0;
}

/* Loading placeholder */
.vk-connect-remote-placeholder {
  height: clamp(560px, 72vh, 820px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  color: var(--muted-strong);
}

.vk-browser-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.vk-browser-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.vk-connect-remote-placeholder strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
}

.vk-connect-remote-placeholder p {
  margin: 0 auto;
  max-width: 360px;
  line-height: 1.6;
  font-size: 14px;
}

.vk-connect-remote-stage.is-placeholder .vk-connect-remote-image {
  display: none;
}

.vk-connect-remote-stage:not(.is-placeholder) .vk-connect-remote-placeholder {
  display: none;
}

/* Controls panel */
.vk-connect-remote-controls {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #141821;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 2;
  backdrop-filter: blur(18px);
}

.vk-connect-remote-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vk-connect-context-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(118, 95, 255, 0.28);
  background: rgba(118, 95, 255, 0.14);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.vk-connect-private-note {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.vk-connect-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

/* Input row */
.vk-connect-input-row { display: block; }

.vk-connect-input {
  display: block;
  width: 100%;
  min-height: 48px;
  max-height: 128px;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 5, 11, 0.98);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  outline: none;
  transition: border-color 0.15s;
  resize: none;
  overflow-y: auto;
  font-family: inherit;
}

.vk-connect-remote[data-field-kind="password"] .vk-connect-input {
  -webkit-text-security: disc;
}

.vk-connect-input:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(155, 83, 255, 0.2);
}

.vk-connect-input::placeholder {
  color: var(--muted);
}

.vk-connect-send-btn {
  min-height: 48px;
  width: auto;
  min-width: 118px;
  padding: 0 16px;
  font-size: 14px;
  border-radius: 6px;
}

/* Actions */
.vk-connect-action-row {
  display: grid;
  grid-template-columns: 48px minmax(118px, auto);
  gap: 8px;
}

.vk-key-btn {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.vk-key-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.vk-key-btn-delete {
  width: 56px;
  justify-self: end;
}

.vk-connect-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
  line-height: 1.35;
}

/* ==========  VK Captcha Challenge Panel  ========== */
.vk-captcha-panel {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  padding: 16px;
}

.vk-captcha-card {
  background: var(--card);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.vk-captcha-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
}

.vk-captcha-desc {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.vk-captcha-img-wrap {
  margin: 0 auto 16px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #fff;
}

.vk-captcha-img-wrap img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 60px;
}

.vk-captcha-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.vk-captcha-input-row input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
}

.vk-captcha-input-row input::placeholder {
  letter-spacing: 0;
  font-weight: 400;
  color: var(--muted);
}

.vk-captcha-status {
  font-size: 13px;
  min-height: 20px;
  margin-bottom: 8px;
  color: var(--muted);
}

.vk-captcha-status.is-error {
  color: #ff5555;
}

.vk-captcha-status.is-success {
  color: #50fa7b;
}

.toggle-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
}

.toggle-copy {
  display: grid;
  gap: 6px;
}

.toggle-card strong {
  display: block;
}

.toggle-card small {
  display: block;
  color: var(--muted);
  line-height: 1.5;
}

.emphasis-copy .toggle-copy strong,
.emphasis-copy .toggle-copy small {
  color: var(--text);
}

.emphasis-copy .toggle-copy small {
  font-size: 16px;
  font-weight: 700;
}

.emphasis-copy .toggle-copy strong {
  font-size: 18px;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.toggle-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 72px;
  height: 40px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.toggle-switch-ui {
  position: relative;
  display: inline-flex;
  width: 72px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 10px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.toggle-switch-ui::before {
  content: "OFF";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.56);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.toggle-switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #eef2ff 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.18s ease;
}

.toggle-switch input:checked + .toggle-switch-ui {
  border-color: rgba(0, 255, 136, 0.38);
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.82), rgba(94, 103, 255, 0.72));
}

.toggle-switch input:checked + .toggle-switch-ui::before {
  content: "ON";
  left: 12px;
  right: auto;
  color: rgba(9, 10, 16, 0.82);
}

.toggle-switch input:checked + .toggle-switch-ui::after {
  transform: translateX(32px);
}

.toggle-switch input:focus-visible + .toggle-switch-ui {
  box-shadow:
    inset 0 10px 24px rgba(0, 0, 0, 0.18),
    0 0 0 4px rgba(155, 83, 255, 0.22);
}

.toggle-card.is-locked {
  opacity: 0.58;
}

.settings-rules-card > .toggle-card,
.comments-settings-card > .toggle-card {
  width: 100%;
}

.settings-toggle-row {
  min-height: 96px;
}

.signature-editor-card,
.comments-settings-card {
  gap: 14px;
}

.editor-shell {
  display: grid;
  gap: 12px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-strong);
  cursor: pointer;
  font-weight: 800;
}

.editor-surface {
  min-height: 140px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(5, 5, 11, 0.98);
  color: var(--text);
  outline: none;
  line-height: 1.7;
}

.editor-surface:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(155, 83, 255, 0.22);
}

.editor-surface.is-empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}

.editor-surface a {
  color: var(--accent-sky);
}

.editor-surface strong,
.editor-surface b {
  font-weight: 800;
}

.editor-surface em,
.editor-surface i {
  font-style: italic;
}

.hub-icon-light {
  color: rgba(255, 255, 255, 0.96);
  font-size: 26px;
  font-weight: 900;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.16);
}

.sync-grid,
.subscription-layout,
.referral-layout,
.help-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.subscription-layout {
  grid-template-columns: minmax(0, 1fr);
}

.referral-layout {
  grid-template-columns: minmax(0, 760px);
}

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

.stats-grid,
.plans-grid,
.links-grid {
  display: grid;
  gap: 16px;
}

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

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

.subscription-payment-consent {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.subscription-payment-consent a {
  color: var(--accent-sky);
}

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

#subscription-summary {
  display: grid;
  gap: 12px;
}

#referral-summary {
  display: grid;
  gap: 1.5em;
}

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.bridges-grid {
  display: grid;
  gap: 12px;
}

.bridge-card,
.plan-card,
.summary-card,
.job-card,
.compact-item,
.empty-card {
  padding: 20px;
}

.bridge-top,
.plan-top,
.job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.bridge-card h3,
.plan-card h3 {
  margin: 8px 0 0;
}

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

.bridge-meta dt {
  color: var(--muted);
  font-size: 13px;
}

.bridge-meta dd {
  margin: 6px 0 0;
  color: var(--text);
  font-weight: 700;
}

.bridge-settings {
  overflow: auto;
  margin: 16px 0 0;
  padding: 14px;
  border-radius: 16px;
  background: rgba(4, 12, 20, 0.92);
  color: #c5e7ff;
  font-size: 12px;
  line-height: 1.5;
}

.summary-card h3 {
  margin: 10px 0 12px;
}

.plan-card.is-active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.035);
}

.plan-top strong {
  font-size: 24px;
}

.plan-title {
  line-height: 1.2;
}

.plan-price {
  display: grid;
  gap: 4px;
  justify-items: end;
  text-align: right;
}

.plan-price small {
  max-width: 210px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.plan-periods {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.subscription-addons-panel {
  display: grid;
  gap: 18px;
}

.subscription-addons-panel[hidden] {
  display: none;
}

.subscription-addons-copy {
  display: grid;
  gap: 7px;
}

.subscription-addons-copy h3,
.subscription-addons-copy p {
  margin: 0;
}

.subscription-addons-copy p {
  color: var(--muted-strong);
  line-height: 1.5;
}

.subscription-addons-copy .field-note {
  color: var(--muted);
  font-size: 13px;
}

.subscription-capacity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  border-block: 1px solid var(--line);
  padding-block: 12px;
}

.subscription-capacity > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-inline: 12px;
}

.subscription-capacity > span + span {
  border-left: 1px solid var(--line);
}

.subscription-capacity > span[hidden] {
  display: none;
}

.subscription-capacity small {
  color: var(--muted);
  font-size: 12px;
}

.subscription-capacity strong {
  font-size: 22px;
}

.modal-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-card-head > div {
  display: grid;
  gap: 6px;
}

.modal-close-button {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.subscription-addons-modal {
  max-height: min(720px, calc(100vh - 36px));
  overflow-y: auto;
}

.subscription-addons-assurance {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid var(--accent-sky);
  color: var(--muted-strong);
  line-height: 1.5;
}

.subscription-addon-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.subscription-addon-product > span {
  display: grid;
  gap: 4px;
}

.subscription-addon-product small {
  color: var(--muted);
  line-height: 1.35;
}

.subscription-addon-product > strong {
  flex: 0 0 auto;
  text-align: right;
}

.subscription-addon-price-summary {
  display: grid;
  border-block: 1px solid var(--line);
}

.subscription-addon-price-summary > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 11px;
}

.subscription-addon-price-summary > span + span {
  border-top: 1px solid var(--line);
}

.subscription-addon-price-summary small {
  color: var(--muted);
}

.subscription-addon-price-summary strong {
  text-align: right;
  font-size: 14px;
}

.plan-periods[hidden] {
  display: none;
}

.periods-title {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.period-row:hover {
  background: rgba(255, 255, 255, 0.08);
}

.period-row > span:last-child {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
  font-weight: 700;
}

.period-row small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.compact-list {
  display: grid;
  gap: 12px;
}

.compact-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compact-item span,
.job-card p,
.summary-card p {
  color: var(--muted);
}

.referral-url {
  overflow-wrap: anywhere;
  font-family: "JetBrains Mono", "SFMono-Regular", monospace;
  font-size: 12px;
  color: var(--muted-strong);
}

.tariff-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.migration-form {
  margin-top: 22px;
}

.inline-status {
  min-height: 0;
  margin-top: 12px;
  color: var(--success);
  font-weight: 700;
}

.inline-status:empty {
  display: none;
}

.about-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 16px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 800;
}

.link-tile {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-weight: 700;
}

.hero,
.menu-shell,
.screen,
.panel,
.subpanel {
  scroll-margin-top: 36px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.account-status-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 255, 136, 0.18);
  background: rgba(0, 255, 136, 0.08);
  color: #dcffef;
  font-weight: 700;
}

.account-status-line.is-inactive {
  border-color: rgba(255, 125, 145, 0.18);
  background: rgba(255, 125, 145, 0.08);
  color: #ffe3e9;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 18px rgba(0, 255, 136, 0.7);
}

.account-status-line.is-inactive .status-dot {
  background: var(--danger);
  box-shadow: 0 0 18px rgba(255, 125, 145, 0.7);
}

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

.fact-card,
.selector-empty,
.activity-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)),
    linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(168, 85, 247, 0.12)),
    rgba(7, 7, 15, 0.84);
}

.fact-card {
  padding: 18px 20px;
}

.fact-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.fact-card strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.selector-empty {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.selector-empty p,
.activity-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.activity-feed {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.comments-admin-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.comments-admin-top-thread {
  margin-top: 18px;
}

.comments-thread-excerpt {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.comments-thread-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.activity-card {
  padding: 20px;
}

.activity-top,
.activity-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.activity-meta {
  margin-top: 14px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.activity-meta span,
.activity-status {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
}

.activity-status {
  border-color: rgba(0, 255, 136, 0.18);
  background: rgba(0, 255, 136, 0.1);
  color: #dcffef;
}

.activity-status.is-error {
  border-color: rgba(255, 125, 145, 0.18);
  background: rgba(255, 125, 145, 0.1);
  color: #ffe0e7;
}

.section-head .section-actions,
.panel-head .section-actions {
  margin-top: 0;
}

.panel > .section-actions,
.screen > .section-actions,
.panel form + .section-actions {
  margin-top: 18px;
}

.comments-settings-card .section-actions,
.signature-editor-card .section-actions {
  margin-top: 6px;
}

#sync-bridges .bridges-grid,
#sync-stats .activity-feed,
#sync-comments-admin .comments-admin-metrics,
#sync-migration .tariff-strip,
#subscription-summary,
#about-view,
#faq-view,
#links-view {
  margin-top: 22px;
}

@media (max-width: 1100px) {
  .hero,
  .sync-grid,
  .content-plan-shell,
  .subscription-layout,
  .referral-layout,
  .help-layout {
    grid-template-columns: 1fr;
  }

  .sync-hub,
  .menu-tabs,
  .content-plan-summary,
  .plans-grid,
  .comments-admin-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-plan-composer {
    position: static;
  }

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

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

@media (max-width: 760px) {
  .page-shell {
    padding:
      calc(10px + env(safe-area-inset-top, 0px))
      max(10px, env(safe-area-inset-right, 0px))
      calc(44px + env(safe-area-inset-bottom, 0px))
      max(10px, env(safe-area-inset-left, 0px));
  }

  .topbar,
  .hero,
  .screen,
  .panel,
  .subpanel {
    border-radius: 24px;
  }

  .topbar {
    position: static;
    padding: 14px 18px;
  }

  .menu-shell {
    border-radius: 24px;
    padding: 10px;
  }

  .hero h1 {
    font-size: clamp(24px, 8vw, 34px);
  }

  .section-head h2,
  .panel h3 {
    font-size: clamp(20px, 6vw, 28px);
  }

  .menu-tabs,
  .sync-hub,
  .content-plan-head,
  .content-plan-filters,
  .plans-grid,
  .links-grid,
  .form-grid,
  .settings-grid,
  .settings-section-grid,
  .settings-summary-grid,
  .settings-rules-grid,
  .bridge-form-panel,
  .bridge-endpoint,
  .bridge-meta,
  .hero-metrics,
  .dashboard-facts,
  .comments-admin-metrics {
    grid-template-columns: 1fr;
  }

  .content-plan-actions {
    justify-content: stretch;
  }

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

  .subscription-capacity > span,
  .subscription-capacity > span + span {
    padding: 10px 12px;
    border-left: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
  }

  .content-plan-head {
    gap: 14px;
  }

  .content-plan-actions .button,
  .content-plan-composer-actions .button {
    width: 100%;
  }

  .content-plan-board {
    padding: 14px;
    border-radius: 22px;
  }

  .content-plan-filter-button,
  .content-plan-sheet-close {
    display: inline-flex;
  }

  .content-plan-filter-button {
    width: 100%;
    justify-content: center;
  }

  body.is-content-plan-filters-open .screen[data-screen="content-plan"],
  body.is-content-plan-composer-open .screen[data-screen="content-plan"] {
    overflow: visible;
    backdrop-filter: none;
  }

  .content-plan-filters,
  .content-plan-composer {
    position: fixed;
    top: auto;
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 120;
    max-height: min(82dvh, 720px);
    overflow: auto;
    padding: 16px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.16);
    background:
      linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025)),
      rgba(13, 12, 24, 0.98);
    box-shadow: 0 24px 80px rgba(0,0,0,0.55);
    transform: translateY(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  .content-plan-composer {
    top: max(10px, env(safe-area-inset-top, 0px));
    z-index: 121;
    max-height: none;
    min-height: 0;
  }

  body.is-content-plan-filters-open .content-plan-filters,
  body.is-content-plan-composer-open .content-plan-composer {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .content-plan-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(10px);
  }

  body.is-content-plan-filters-open .content-plan-sheet-backdrop,
  body.is-content-plan-composer-open .content-plan-sheet-backdrop {
    display: block;
  }

  .content-plan-composer .panel-head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
  }

  .content-plan-card,
  .content-plan-card-top,
  .content-plan-card-meta,
  .content-plan-card-actions,
  .content-plan-composer-actions,
  .content-plan-time-grid {
    grid-template-columns: 1fr;
  }

  .content-plan-card-time {
    justify-content: flex-start;
  }

  .content-plan-form {
    gap: 12px;
    margin-top: 12px;
  }

  .content-plan-media-field {
    padding: 12px;
    border-radius: 18px;
  }

  .content-plan-media-actions {
    grid-template-columns: 1fr;
  }

  .content-plan-media-button {
    min-height: 38px;
    padding: 0 8px;
  }

  .content-plan-rules-card {
    grid-template-columns: 1fr;
  }

  .content-plan-rules-card .button {
    width: 100%;
  }

  .content-plan-text-editor {
    min-height: 210px;
  }

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

  .telegram-post-media figure {
    max-height: 220px;
  }

  .telegram-post-preview {
    width: calc(100% - 28px);
  }

  .telegram-post-share {
    right: -32px;
    width: 28px;
    height: 28px;
    font-size: 18px;
  }

  .content-plan-format-toolbar {
    gap: 6px;
  }

  .content-plan-format-toolbar button,
  .content-plan-selection-menu button {
    min-height: 32px;
    padding: 0 10px;
  }

  .content-plan-selection-menu {
    border-radius: 18px;
    flex-wrap: wrap;
  }

  .content-plan-period-nav {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .content-plan-period-nav strong {
    grid-column: auto;
    order: 0;
    min-height: 48px;
  }

  .content-plan-period-nav #content-plan-today {
    grid-column: 1 / -1;
  }

  .content-plan-arrow {
    width: 36px;
    height: 36px;
  }

  .calendar-week-grid,
  .calendar-grid-month {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .calendar-weekday {
    display: none;
  }

  .calendar-month-cell {
    min-height: 96px;
    border-right: 0;
  }

  .calendar-month-cell.is-muted {
    display: none;
  }

  .calendar-week-day {
    min-height: 120px;
  }

  .calendar-week-day header {
    justify-items: start;
    grid-template-columns: auto auto;
    align-items: center;
  }

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

  .content-plan-metric {
    padding: 12px;
  }

  .content-plan-metric strong {
    font-size: 20px;
  }

  .mobile-agenda-slot {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .mobile-post-card > button {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .mobile-post-card em {
    grid-column: 2;
    justify-self: start;
  }

  .mobile-post-card small {
    grid-column: 2;
  }

  .menu-tab {
    justify-content: flex-start;
    min-height: 52px;
    padding: 12px 14px;
    font-size: 15px;
  }

  .screen {
    padding: 22px 18px;
  }

  .panel,
  .subpanel {
    padding: 20px 18px;
  }

  .hero {
    padding: 24px 18px;
  }

  .bridge-endpoint {
    padding: 18px;
  }

  .bridge-endpoint-copy h4 {
    font-size: 18px;
  }

  .hero-metric {
    min-height: 0;
    padding: 18px;
  }

  .hub-card {
    min-height: 0;
    padding: 18px;
    border-radius: 22px;
  }

  .hub-card strong {
    font-size: 17px;
  }

  .hub-card small {
    font-size: 13px;
    line-height: 1.45;
  }

  .segmented-control {
    width: 100%;
    border-radius: 22px;
  }

  .segment {
    min-height: 48px;
    padding: 0 12px;
    text-align: center;
    white-space: nowrap;
  }

  .activity-top,
  .activity-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .toggle-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
  }

  .toggle-switch {
    justify-self: flex-start;
  }

  .vk-connect-remote-stage,
  .vk-connect-remote-placeholder {
    height: clamp(560px, 74vh, 820px);
  }
}

@media (max-width: 520px) {
  .page-shell {
    padding:
      calc(8px + env(safe-area-inset-top, 0px))
      max(8px, env(safe-area-inset-right, 0px))
      calc(32px + env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px));
  }

  .menu-tabs,
  .sync-hub {
    grid-template-columns: 1fr;
  }

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

  .settings-action-card .button-inline {
    width: 100%;
  }

  .hero-metrics,
  .hero-quota-grid,
  .modal-actions {
    grid-template-columns: 1fr;
  }

  .settings-vk-auth-actions {
    width: 100%;
  }

  .section-actions {
    width: 100%;
  }

  .vk-connect-remote-stage,
  .vk-connect-remote-placeholder {
    height: clamp(500px, 68vh, 700px);
    border-radius: 0;
  }

  .vk-connect-remote-placeholder {
    padding: 18px;
  }

  .vk-connect-remote-controls {
    padding:
      10px
      10px
      calc(10px + env(safe-area-inset-bottom, 0px))
      10px;
  }

  .vk-connect-remote-meta {
    justify-content: space-between;
  }

  .vk-connect-context-pill {
    width: auto;
    justify-content: center;
  }

  .vk-browser-connection-state > span:last-child,
  .vk-connect-private-note {
    display: none;
  }

  .vk-connect-composer {
    grid-template-columns: 1fr;
  }

  .vk-connect-input-row {
    display: block;
  }

  .vk-connect-input {
    min-height: 48px;
    font-size: 16px;
  }

  .vk-connect-action-row {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .vk-connect-send-btn {
    width: 100%;
  }

  .vk-connect-send-btn {
    min-height: 48px;
    margin-top: 2px;
  }

  .vk-key-btn {
    min-height: 38px;
    font-size: 12px;
  }

  .vk-browser-reload-btn {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  .brand {
    justify-content: flex-start;
    gap: 10px;
    font-size: 14px;
    text-align: left;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .topbar,
  .hero,
  .screen,
  .panel,
  .subpanel {
    border-radius: 20px;
  }

  .topbar {
    padding: 12px 14px;
  }

  .menu-shell {
    border-radius: 20px;
    padding: 8px;
  }

  .hero,
  .screen,
  .panel,
  .subpanel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hub-card {
    padding: 16px;
  }

  .hub-card strong {
    font-size: 16px;
  }

  .hub-card small {
    font-size: 12px;
  }

  .hub-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    font-size: 18px;
  }

  .button,
  .menu-tab {
    min-height: 46px;
  }

  .menu-tab {
    padding: 10px 12px;
    font-size: 14px;
  }

  .hero {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .screen,
  .panel,
  .subpanel,
  .field,
  .bridge-endpoint {
    padding-left: 14px;
    padding-right: 14px;
  }

  .section-copy {
    margin-top: 14px;
  }

  .account-status-line {
    max-width: 100%;
  }

  .fact-card strong,
  .activity-card strong {
    font-size: 16px;
  }
}
