/* Filamet Hub — минимализм, первое касание */
:root {
  --bg: #08080a;
  --surface: #141418;
  --text: #f4f4f6;
  --muted: #8b8b96;
  --accent: #ff6b35;
  --accent2: #ff8f66;
  --border: #2a2a32;
  --ok: #3dd68c;
  --radius: 16px;
  --touch-max: 440px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ——— Вход (мгновенный первый экран) ——— */
.login-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
}
.login-card {
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.login-card h1 {
  font-size: 1.75rem;
  margin: 16px 0 8px;
}
.login-lead {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 24px;
}
.brand-mark.lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: block;
  object-fit: cover;
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
}
.telegram-login-mount {
  min-height: 48px;
  display: flex;
  justify-content: center;
  margin: 8px 0;
}
.login-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 16px;
}
.login-checking {
  font-size: 0.85rem;
  color: var(--accent2);
  margin-top: 12px;
}
body.guest .touch-shell { display: none !important; }
body.authenticated .login-gate { display: none !important; }

/* Карточки полей */
.profile-card,
.field-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  width: 100%;
}
.profile-card { margin-bottom: 4px; }
.profile-top { margin-bottom: 12px; }
.profile-name {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 6px 0 4px;
  line-height: 1.25;
}
.profile-meta {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.role-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 6px;
}
.role-badge.owner {
  background: rgba(255, 107, 53, 0.2);
  color: var(--accent2);
}
.role-badge.client {
  background: rgba(61, 214, 140, 0.12);
  color: var(--ok);
}
.profile-networks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.net-pill {
  font-size: 0.75rem;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.net-pill.on { border-color: var(--ok); color: var(--ok); }
.net-pill.off { opacity: 0.65; }

.sphere-row { margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.field-help {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  margin: -4px 0 10px;
}
.field-select,
.field-select-static {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  appearance: none;
}
.field-select-static {
  margin: 0;
  background: var(--bg);
}
.field-textarea {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg) !important;
  color: var(--text) !important;
  -webkit-text-fill-color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
  min-height: 88px;
}
.field-textarea::placeholder { color: #6a6a75; opacity: 1; }
.field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.15);
}

.btn-outline {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent2); }
.btn-outline.block { display: block; }

.settings-inline { margin-bottom: 16px; max-height: 50vh; overflow-y: auto; }
.sheet-panel-lg { max-height: 90vh; overflow-y: auto; }

.status-banner {
  text-align: center;
  font-size: 0.78rem;
  padding: 10px 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.status-banner.warn { color: #f5c542; }
.status-banner.err { color: #ff6b6b; }
.status-banner.info { color: var(--accent2); }

.net-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.net-chip {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.net-chip.ok { border-color: var(--ok); color: var(--ok); }

.sphere-select {
  flex: 1;
  max-width: 140px;
  margin: 0 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 8px;
  font-size: 0.85rem;
}

.progress-wrap { margin-top: -12px; }
.progress-bar {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.2s;
}
.progress-bar.indeterminate span {
  width: 42% !important;
  animation: progress-indeterminate 1.2s ease-in-out infinite;
}
@keyframes progress-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}
.progress-text {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}

.sheet-desc.warn { color: #f5c542; font-size: 0.85rem; }
.test-auth-box { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.input-text {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}
.settings-actions { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.btn-action {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.btn-action-secondary { opacity: 0.9; }
.network-list { list-style: none; margin: 12px 0; }
.network-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.network-list .net.ok { color: var(--ok); font-weight: 600; }

.sphere-target-hint {
  margin: 6px 0 10px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}
.queue-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}
.queue-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
}
.queue-tab.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 107, 53, 0.12);
}
.settings-section {
  margin-bottom: 20px;
}
.settings-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 10px;
}
.settings-soon { opacity: 0.85; }
.link-inline {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.plan-settings-hint { margin: 0 0 14px; }
.q-item-stats {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.q-item-stats-hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.q-item-stat-row {
  margin: 4px 0 0;
  font-size: 0.85rem;
}
.q-item-stat-row a {
  color: var(--accent);
  text-decoration: none;
}
.queue-sheet-lead {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.35;
}
.queue-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.queue-card,
.q-item {
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2, var(--surface));
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.q-item.is-open {
  border-color: rgba(255, 107, 53, 0.35);
}
.q-item-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 2px 8px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.q-summary-date {
  grid-column: 1;
  font-size: 0.78rem;
  color: var(--muted);
}
.q-summary-cap {
  grid-column: 1;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-summary-meta {
  grid-column: 1;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.q-summary-chevron {
  grid-column: 2;
  grid-row: 1 / 4;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  align-self: center;
  transition: transform 0.15s;
}
.q-item.is-open .q-summary-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.q-item-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
}
.q-item-body[hidden] { display: none !important; }
.queue-card.done,
.q-item.done { border-color: rgba(61, 216, 140, 0.35); opacity: 0.85; }
.queue-card.fail,
.q-item.fail { border-color: rgba(255, 107, 107, 0.35); }
.q-item-targets {
  margin: 10px 0 4px;
}
.q-item-targets-title {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.q-target-cards { margin-bottom: 4px; }
.q-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.q-item-time {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.q-item-chip {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.q-item-cap {
  width: 100%;
  min-height: 2.6em;
  max-height: 5.2em;
  resize: vertical;
  font-size: 0.84rem;
  line-height: 1.35;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin: 0 0 8px;
}
.q-item-cap::placeholder { color: var(--muted); }
.q-item-cap:focus {
  outline: none;
  border-color: rgba(255, 140, 60, 0.5);
}
.q-item-when {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  padding: 8px 10px;
  border-radius: 10px;
}
.q-item-del {
  flex-shrink: 0;
  font-size: 0.78rem;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 107, 107, 0.45);
  background: transparent;
  color: #e08080;
  cursor: pointer;
}
.q-item-del:active { opacity: 0.85; }
.q-item-row {
  display: block;
  margin-top: 6px;
}
.q-item-row select {
  width: 100%;
  font-size: 0.82rem;
  padding: 8px 10px;
  border-radius: 10px;
}
.q-item-done-line {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.q-item-err {
  font-size: 0.75rem;
  color: #e08080;
  margin: 6px 0 0;
}

/* ——— Первое касание ——— */
.touch-shell {
  max-width: var(--touch-max);
  margin: 0 auto;
  min-height: calc(100vh - 34px);
  display: flex;
  flex-direction: column;
  padding: 0 20px 24px;
}

.touch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 8px;
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.header-brand .brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  display: block;
  object-fit: cover;
}
.brand-name { font-size: 1.15rem; font-weight: 600; letter-spacing: 0.02em; }
.header-end {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 0;
}
.header-user-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  max-width: 42vw;
}
.header-display-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.header-user-role {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.header-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.2);
}
.header-avatar:active { opacity: 0.88; }
.header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}
.header-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: #c8c8d0;
  letter-spacing: 0.02em;
  background: #2a2a30;
}
.header-avatar-fallback:not(.has-initials) {
  background: #2a2a30 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23888'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0 2c-4 0-7 2-7 4v1h14v-1c0-2-3-4-7-4z'/%3E%3C/svg%3E") center/58% no-repeat;
}
.main-lead {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 4px;
}
.sphere-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 6px;
}
.sphere-targets {
  margin-top: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}
.sphere-targets-label { color: var(--muted); }
.sphere-targets-hint { color: var(--muted); }
.link-inline {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent2);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.target-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 4px 6px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.8rem;
}
.target-chip-mark {
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--accent2);
}
.touch-actions-main { margin-top: 4px; }
.caption-field { margin-top: 12px; }
.account-section { margin-bottom: 20px; }
.account-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 6px;
}
.account-section-desc {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 12px;
}
.net-cards { display: flex; flex-direction: column; gap: 10px; }
.net-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.net-card.is-on { border-color: rgba(61, 214, 140, 0.45); }
.net-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.net-card-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--surface);
  color: var(--accent2);
  flex-shrink: 0;
}
.net-card-title { flex: 1; font-weight: 600; font-size: 0.95rem; }
.net-card-status {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: lowercase;
}
.net-card.is-on .net-card-status { color: var(--ok); }
.net-card-btn { width: 100%; margin-top: 4px; }
.tg-channel-extra { margin-top: 8px; }
.target-cards { display: flex; flex-direction: column; gap: 8px; }
.target-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
}
.target-card.is-on {
  border-color: rgba(255, 107, 53, 0.55);
  background: rgba(255, 107, 53, 0.08);
}
.target-card input { margin-top: 4px; flex-shrink: 0; }
.target-card-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  background: var(--surface);
  color: var(--accent2);
  flex-shrink: 0;
}
.target-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.target-card-name { font-weight: 600; font-size: 0.92rem; }
.target-card-sub { font-size: 0.82rem; color: var(--muted); }
.sheet-lead {
  font-size: 0.88rem;
  color: var(--muted);
  margin: -4px 0 14px;
  line-height: 1.4;
}
.tg-channel-block {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.tg-channel-block .field-label { margin-bottom: 8px; }
.tg-channel-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.tg-channel-row .field-select { flex: 1; min-width: 0; }
.tg-channel-hint {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 8px;
}
.hub-guide {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 107, 53, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.25);
}
.hub-guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.88rem;
}
.hub-guide-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.hub-guide-steps {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.hub-guide-link {
  border: none;
  background: none;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hub-guide-link:hover { color: var(--text); }

.sphere-block { margin-bottom: 12px; }
.sphere-block .field-select { width: 100%; }
.sphere-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.sphere-picker-row .field-select {
  flex: 1 1 180px;
  min-width: 0;
}
.sphere-settings-block { margin-top: 4px; }
.history-sphere-row { margin: 10px 0 12px; }
.compact-net-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compact-net-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  overflow: hidden;
}
.compact-net-head {
  width: 100%;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
}
.compact-net-head:active {
  background: rgba(255, 255, 255, 0.03);
}
.compact-net-row.is-open .compact-net-head {
  border-bottom: 1px dashed var(--line);
}
.compact-net-row.is-on .compact-net-status {
  color: var(--ok, #5ad19c);
}
.compact-net-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}
.compact-net-mark {
  min-width: 34px;
  text-align: center;
  border-radius: 8px;
  background: rgba(124, 92, 255, 0.12);
  color: var(--accent2);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 6px;
}
.compact-net-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.compact-net-status {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 44%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.compact-net-body {
  padding: 10px;
}
.sphere-targets {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--accent2);
  line-height: 1.35;
}
.cloud-delete-row { margin-top: 4px; }
.cloud-delete-days { margin-top: 8px; width: 100%; }
.account-line {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.history-platform {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.history-platform:first-of-type { border-top: none; padding-top: 0; }
.history-link {
  color: var(--link, #6eb6ff);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.history-nolink {
  font-size: 0.9rem;
  color: var(--muted);
}
.cabinet-pane-lead {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}
.history-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  flex-shrink: 0;
}
.history-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.history-metric .hm-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}
.history-metric--labeled .hm-lbl {
  font-size: 0.68rem;
  color: var(--muted);
  margin-right: 2px;
  text-transform: lowercase;
}
.history-metric .hm-val {
  min-width: 1.2em;
  text-align: right;
}
.history-fail-msg {
  font-size: 0.78rem;
  color: #ff8a8a;
  text-align: right;
  max-width: 55%;
}
.history-hint {
  list-style: none;
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: 10px;
  background: rgba(110, 182, 255, 0.08);
  border: 1px solid rgba(110, 182, 255, 0.2);
}
.history-trend {
  list-style: none;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  border-radius: 10px;
  border: 1px solid rgba(255, 107, 53, 0.35);
  background: rgba(255, 107, 53, 0.08);
  color: var(--text);
}
.history-analysis-actions li {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}
.history-analysis-actions {
  padding-left: 0;
}
.history-analysis-actions li::before {
  content: "→ ";
  color: var(--accent);
  font-weight: 600;
}
.history-funnel {
  margin-bottom: 8px;
}
.funnel-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 0.78rem;
}
.funnel-name {
  color: var(--muted);
}
.funnel-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.funnel-bar {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 107, 53, 0.55));
  min-width: 2px;
}
.funnel-meta {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-analysis {
  margin: 6px 0 0;
}
.history-analysis-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.history-analysis-toggle:hover {
  border-color: rgba(255, 107, 53, 0.45);
}
.history-analysis.is-open .history-analysis-toggle {
  border-color: rgba(255, 107, 53, 0.55);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: rgba(255, 107, 53, 0.08);
}
.han-label {
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}
.han-chip {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.han-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  flex-shrink: 0;
  margin-left: 2px;
  transition: transform 0.15s;
}
.history-analysis.is-open .han-chevron {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.history-analysis-body {
  padding: 10px 12px 12px;
  border: 1px solid rgba(255, 107, 53, 0.35);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: rgba(0, 0, 0, 0.2);
}
.history-analysis-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.history-retention-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}
.history-retention-svg {
  width: 100%;
  max-width: 320px;
  height: auto;
  display: block;
}
.history-retention-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.history-retention-area {
  stroke: none;
}
.history-retention-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
  max-width: 320px;
}
.history-analysis-list {
  margin: 0;
  padding-left: 1rem;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text);
}
.history-analysis-list li { margin-bottom: 5px; }
.history-analysis-list li:last-child { margin-bottom: 0; }
.history-analysis-note {
  margin: 0;
  line-height: 1.4;
  font-size: 0.78rem;
  color: var(--muted);
}
.history-stat {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cabinet-tabs .cabinet-tab { font-size: 0.8rem; padding: 8px 6px; }
.tab-badge {
  display: inline-block;
  min-width: 1.25rem;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
}
.tab-badge[hidden] { display: none !important; }
.cabinet-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}
.cabinet-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
}
.cabinet-tab.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 107, 53, 0.12);
}
.cabinet-pane { margin-bottom: 12px; }
.cloud-line {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.cloud-presets { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.preset-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  cursor: pointer;
}
.cabinet-logout { margin: 8px 0 12px; }
.history-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.history-item {
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}
.history-item.is-open {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.12);
}
.history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.history-filters[hidden] { display: none !important; }
.cloud-error {
  color: #ff9b7a;
  font-size: 0.82rem;
  line-height: 1.35;
  margin: 0 0 10px;
}
.client-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.client-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}
.client-card.is-active {
  border-color: rgba(255, 107, 53, 0.45);
}
.client-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.client-card-active {
  font-size: 0.68rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.client-card-yt {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 10px;
}
.client-card-use {
  margin-top: 8px;
  width: 100%;
}
.history-filter {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  cursor: pointer;
}
.history-filter.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 107, 53, 0.12);
}
.history-layout-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 6px;
  padding: 2px 7px;
  flex-shrink: 0;
}
.history-layout-badge.is-vertical {
  background: rgba(120, 180, 255, 0.18);
  color: #9ec5ff;
  border: 1px solid rgba(120, 180, 255, 0.35);
}
.history-layout-badge.is-horizontal {
  background: rgba(255, 180, 100, 0.16);
  color: #ffc88a;
  border: 1px solid rgba(255, 180, 100, 0.35);
}
.history-layout-badge.is-square {
  background: rgba(180, 180, 200, 0.14);
  color: #c8c8d8;
}
.history-item--horizontal .history-summary {
  border-left: 3px solid rgba(255, 180, 100, 0.55);
}
.history-item--vertical .history-summary {
  border-left: 3px solid rgba(120, 180, 255, 0.45);
}
.history-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  gap: 2px 10px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 10px 12px 10px 14px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.history-summary-top {
  display: contents;
}
.history-summary-date {
  grid-column: 1;
  font-size: 0.78rem;
  color: var(--muted);
}
.history-summary-views {
  grid-column: 2;
  grid-row: 1 / 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  align-self: center;
}
.history-summary-views .hm-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}
.history-summary-views.is-empty {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
}
.history-summary-views .hsv-val {
  line-height: 1;
}
.history-summary-cap {
  grid-column: 1;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-summary-meta {
  grid-column: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.3;
}
.history-summary-dot { opacity: 0.55; }
.history-summary-fail { color: #ff9f6b; }
.history-summary-channels {
  color: var(--accent2);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-summary-err {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #ff9f6b;
  opacity: 0.95;
}
.history-section-title {
  margin: 0 0 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.history-section-lead {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}
.history-publish-now {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.history-publish-status {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  line-height: 1.4;
}
.history-publish-status.is-busy {
  background: rgba(255, 107, 53, 0.12);
  border: 1px solid rgba(255, 107, 53, 0.35);
  color: var(--text);
}
.history-publish-status.is-ok {
  background: rgba(80, 200, 120, 0.12);
  border: 1px solid rgba(80, 200, 120, 0.35);
  color: #9fd89f;
}
.history-publish-status.is-err {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.35);
  color: #ff9f9f;
}
.history-publish-status[hidden] { display: none !important; }
.history-partial-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}
.history-requeue {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.history-requeue-title {
  flex: 1 1 100%;
  margin-bottom: 0;
}
.history-requeue-label {
  font-size: 0.82rem;
  color: var(--muted);
}
.history-requeue-dt {
  flex: 1 1 160px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.88rem;
}
.history-requeue-btn { flex-shrink: 0; }
.history-summary-chevron {
  display: none;
}
.history-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
}
.history-body[hidden] { display: none !important; }
.history-item.is-open .history-summary {
  padding-bottom: 8px;
}
.history-item.fail { border-color: rgba(255, 107, 107, 0.35); }
.history-item.partial { border-color: rgba(255, 180, 80, 0.28); }
.history-partial-banner {
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.history-partial-ok { color: #9fd89f; margin: 0 0 6px; }
.history-partial-fail { color: var(--muted); margin: 0; }
.history-partial-fail:last-child { margin-bottom: 0; }
.history-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.history-sphere { color: var(--muted); }
.history-cap { font-size: 0.85rem; color: var(--muted); margin: 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-fact { font-size: 0.8rem; color: var(--ok); margin: 2px 0 8px; }
.history-err { font-size: 0.8rem; color: #ff6b6b; margin-top: 4px; }
.history-stats-hint {
  font-size: 0.82rem;
  color: var(--accent);
  padding: 8px 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: rgba(255, 107, 53, 0.08);
  list-style: none;
}
.history-metrics-warn {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}
.history-platform-stale .history-nolink { color: #ff9f6b; }
.history-republish-btn { border-color: rgba(255, 159, 107, 0.45); }
.history-link {
  display: inline-block;
  margin-top: 6px;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.88rem;
}
.history-planned { font-size: 0.8rem; margin: 4px 0 6px; }
.history-extra-lead { font-size: 0.82rem; margin: 10px 0 4px; color: var(--text); font-weight: 600; }
.history-retry {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.history-retry-btn {
  font-size: 0.82rem;
  padding: 8px 12px;
  margin-top: 6px;
  width: 100%;
  max-width: 280px;
}
.history-platform-fail + .history-retry-btn {
  margin-bottom: 4px;
}
#panelNow .field-textarea { margin-top: 12px; }
.promo-ready { margin-bottom: 12px; }
.promo-ready-title { font-size: 1rem; margin-bottom: 10px; }
.promo-ready-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-icon {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 40px; height: 40px;
  border-radius: 12px;
  font-size: 1.1rem;
  cursor: pointer;
}

.touch-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0 28px;
}

.touch-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  padding: 24px;
  overflow: hidden;
}
.touch-upload:hover,
.touch-upload.has-file,
.touch-upload.has-video {
  border-color: var(--accent);
  background: rgba(255, 107, 53, 0.06);
}
.touch-upload.has-video {
  padding: 0;
  cursor: default;
}
.touch-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 152px;
}
.touch-upload.has-video .touch-upload-placeholder {
  display: none;
}
.touch-upload-preview {
  position: absolute;
  inset: 0;
  margin: 0;
  border-radius: inherit;
  min-height: 200px;
}
.touch-upload-preview .hub-video-player {
  width: 100%;
  height: 100%;
  min-height: 200px;
  max-height: 320px;
  object-fit: contain;
  border-radius: inherit;
  background: #111;
}
.touch-upload-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.9;
}
.touch-upload-text { font-size: 1rem; font-weight: 500; text-align: center; }
.touch-upload-hint { font-size: 0.8rem; color: var(--muted); margin-top: 8px; }

.touch-actions { display: flex; flex-direction: column; gap: 12px; }
.btn-hero {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 18px 24px;
  font-size: 1.1rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-hero:hover { background: var(--accent2); }
.btn-hero:active { transform: scale(0.98); }
.btn-hero.block { display: block; }

.btn-secondary-soft {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 0.95rem;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.btn-secondary-soft:hover { border-color: var(--muted); }

.touch-actions-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 4px;
}

.touch-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.link-quiet {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: none;
}
.link-quiet:hover { color: var(--text); }
.dot-sep { color: var(--border); }

/* Sheets */
.sheet { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none !important; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); }
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom));
  border: 1px solid var(--border);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-panel h2 { font-size: 1.2rem; margin-bottom: 8px; }
.sheet-desc { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.sheet-buttons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.btn-connect {
  display: block;
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  font-weight: 500;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #fff;
}
.btn-connect.vk { background: #0077ff; }
.btn-connect.yt { background: #cc0000; }
.btn-connect.tg { background: #2aabee; color: #fff; }
.check-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 0.95rem; }
.ambient-track-wrap {
  margin: -6px 0 14px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ambient-track-wrap[hidden] { display: none !important; }
.ambient-track-label { font-size: 0.82rem; color: var(--muted); }
.ambient-track-wrap .field-select { margin: 0; width: 100%; }
.ambient-track-hint { margin: 0; font-size: 0.78rem; min-height: 1.1em; }

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--ok);
  color: var(--text);
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 0.9rem;
  z-index: 300;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.toast[hidden] { display: none !important; }

.result-panel .result-list {
  list-style: none;
  margin: 16px 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.result-list li {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.92rem;
  line-height: 1.45;
}
.result-list li strong { display: block; margin-bottom: 4px; }
.result-list li span { color: var(--muted); display: block; }
.result-list li a {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent2);
  font-weight: 500;
}
.result-ok { border-color: rgba(61, 214, 140, 0.35); }
.result-fail { border-color: rgba(255, 107, 53, 0.4); }
.result-fail strong::before { content: '✕ '; color: #ff6b6b; }
.result-ok strong::before { content: '✓ '; color: var(--ok); }

.hub-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.hub-tab {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.hub-tab.active {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 -3px 0 var(--accent);
}
.hub-tab .tab-badge:empty { display: none; }
.mobile-telegram-entry {
  margin: 0 0 18px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 107, 53, 0.35);
  background: rgba(255, 107, 53, 0.08);
  text-align: left;
}
.mobile-entry-text {
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 12px;
  color: var(--text);
}
.mobile-entry-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.4;
}
.mobile-entry-btn {
  text-decoration: none;
  display: block;
  text-align: center;
}
.desktop-login-block { margin: 8px 0 0; }
.desktop-login-block .field-select { margin-bottom: 12px; }
.google-login-block { margin: 16px 0; }
.google-login-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 10px 0 0;
  line-height: 1.4;
  text-align: center;
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #1f1f1f;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285f4, #ea4335 50%, #fbbc05 85%, #34a853);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.account-profile { margin-bottom: 8px; }
.account-meta { font-size: 0.85rem; color: var(--muted); margin: 0 0 6px; }
.btn-yandex {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-top: 10px;
  border-radius: 12px;
  border: 1px solid #fc0;
  background: #fc0;
  color: #000;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.promo-redeem-row {
  display: flex;
  gap: 8px;
  margin: 12px 0 8px;
}
.promo-redeem-row .field-select { flex: 1; margin: 0; }
.promo-redeem-row .btn-action { flex-shrink: 0; }
.onboarding-cloud-line {
  font-size: 0.9rem;
  color: var(--accent);
  margin: 0 0 16px;
  text-align: center;
}
.email-login-block { margin: 12px 0 0; }
.email-login-block .field-select { margin-bottom: 10px; }
.email-auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.email-auth-tab {
  flex: 1;
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
}
.email-auth-tab.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 107, 53, 0.12);
}
.email-auth-lead {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}
.email-auth-note {
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.35;
}
.email-login-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.login-alt {
  margin-top: 20px;
  font-size: 0.88rem;
  color: var(--muted);
}
.login-alt summary {
  cursor: pointer;
  color: var(--text);
  margin-bottom: 10px;
}
.plan-lead { margin-bottom: 14px; line-height: 1.5; }
.plan-cloud-connect { margin-bottom: 10px; }
.plan-cloud-status {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.45;
}
.plan-cloud-status .cloud-ok { color: var(--accent2); }
#btnConnectYadisk { margin-bottom: 14px; }
.plan-list { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 16px; }
.plan-card {
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}
.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.plan-filename {
  font-size: 0.88rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.plan-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.plan-video-ok {
  font-size: 0.88rem;
  color: var(--accent2);
  margin: -4px 0 12px;
  line-height: 1.35;
  word-break: break-all;
}
.plan-preview-block { margin-top: 4px; }
.plan-optional { font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.plan-preview-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.plan-preview-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 0.88rem;
}
.plan-preview-status {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
  flex: 1;
  min-width: 140px;
}
.plan-preview-status.has-file { color: var(--accent2); }
.plan-dest { font-size: 0.82rem; color: var(--accent2); margin-top: 8px; }
.vk-group-pick {
  margin-top: 12px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.vk-group-hint { margin: 0; line-height: 1.45; }
.promo-ready {
  margin: 0 0 16px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: rgba(255, 107, 53, 0.08);
}
.promo-ready-title { margin: 0 0 6px; font-size: 1rem; }
.hub-video-wrap {
  position: relative;
  margin: 10px 0 12px;
  direction: ltr;
  text-align: left;
}
.hub-video-player {
  width: 100%;
  max-height: 220px;
  border-radius: 10px;
  background: #111;
  display: block;
}
.video-dismiss {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  z-index: 5;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(12, 12, 16, 0.88);
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1;
  font-family: system-ui, -apple-system, sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.video-dismiss:hover {
  background: rgba(255, 107, 53, 0.28);
  color: #fff;
  border-color: var(--accent2);
}
.video-dismiss:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
.promo-ready-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.promo-ready-actions .btn-hero,
.promo-ready-actions .btn-outline,
.promo-ready-actions .btn-secondary-soft {
  flex: 1 1 140px;
}
.plan-empty { color: var(--muted); font-size: 0.9rem; margin: 8px 0 12px; text-align: center; }
.plan-server-row { margin: 12px 0 16px; font-size: 0.88rem; }
.touch-upload-secondary {
  border-style: dashed;
  opacity: 0.95;
}

/* Pro mode */
body.mode-pro .touch-shell { display: none; }
body.mode-pro .pro-shell { display: grid !important; }

.pro-shell {
  display: none;
  grid-template-columns: 220px 1fr;
  min-height: calc(100vh - 34px);
}
.pro-shell[hidden] { display: none !important; }

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.brand small { display: block; color: var(--muted); font-size: 0.72rem; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-item {
  text-align: left; border: none; background: transparent;
  color: var(--muted); padding: 10px 12px; border-radius: 10px;
  font-size: 0.88rem; cursor: pointer;
}
.nav-item.active, .nav-item:hover { background: rgba(255,107,53,0.1); color: var(--accent2); }

.main { padding: 24px; }
.topbar h1 { font-size: 1.35rem; }
.subtitle { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.panel[hidden] { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.muted { color: var(--muted); font-size: 0.88rem; }
.intro { margin-bottom: 14px; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.kpi-label { font-size: 0.75rem; color: var(--muted); }
.kpi strong { font-size: 1.3rem; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.data-table th, .data-table td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.product-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.product-card.hub-card { border-color: var(--accent); }
.pricing-grid.compact { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pricing-grid.full {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: left;
  position: relative;
}
.price-card.featured { border-color: var(--accent); }
.price { font-size: 1.5rem; font-weight: 700; margin: 10px 0 12px; }
.price small { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.price-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.4;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
}
.price-features { list-style: none; font-size: 0.82rem; line-height: 1.45; }
.price-features li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.price-features li:last-child { border: none; }
.muted-li { color: var(--muted); }
.tag-now, .tag-plan {
  display: inline-block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
}
.tag-now { background: rgba(61, 214, 140, 0.15); color: var(--ok); }
.tag-plan { background: rgba(139, 139, 150, 0.2); color: var(--muted); }
.popular {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.62rem;
  background: var(--accent);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
}
.legend-card { margin-top: 8px; }
.legend-card h2 { font-size: 1rem; margin-bottom: 10px; }
.legend-list { font-size: 0.88rem; color: var(--muted); padding-left: 18px; line-height: 1.5; }
.legend-list code { font-size: 0.8rem; color: var(--accent2); }

.network-list { list-style: none; }
.network-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.net.ok { color: var(--ok); font-weight: 600; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.88rem;
}
.btn-ghost.block { width: 100%; }
.btn-ghost.sm { padding: 8px 12px; font-size: 0.8rem; }

@media (min-width: 600px) {
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 20px; margin-bottom: 0; }
}

@media (max-width: 768px) {
  .pro-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

.process-preview-wrap {
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.process-preview-video {
  display: block;
  width: 100%;
  max-height: 280px;
}

.process-status {
  min-height: 1.2em;
  margin: 8px 0;
  font-size: 0.9rem;
}

.btn-preview {
  width: 100%;
  background: rgba(61, 214, 140, 0.2);
  border: 1px solid rgba(61, 214, 140, 0.8);
  color: #8ff0c2;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-preview:disabled {
  opacity: 0.6;
  cursor: default;
}
