/* Postik Base Design System — Linear / Apple Minimalist Dark */
:root, html, body {
  color-scheme: dark !important;
}

:root {
  /* Minimalist Charcoal Surfaces */
  --bg-base: #09090b;
  --bg-surface: #111113;
  --bg-elevated: #18181b;
  --bg-card: #131316;
  --bg-card-hover: #1b1b1f;
  --bg-card-subtle: rgba(255, 255, 255, 0.03);
  --bg-input: #0e0e11;

  /* Glassmorphism */
  --glass-card: rgba(19, 19, 22, 0.84);
  --glass-card-border: rgba(255, 255, 255, 0.08);
  --glass-specular: rgba(255, 255, 255, 0.12);
  --glass-blur: blur(24px) saturate(160%);

  /* Linear Monochrome White Accents */
  --gold-50: #ffffff;
  --gold-200: #f4f4f5;
  --gold-400: #ffffff;
  --gold-600: #d4d4d8;
  --accent: #ffffff;
  --accent-cyan: #ffffff;
  --accent-primary: #ffffff;
  --accent-secondary: #a1a1aa;
  --accent-gradient: #ffffff;
  --accent-glow: rgba(255, 255, 255, 0.12);
  --accent-subtle: rgba(255, 255, 255, 0.07);
  --on-accent: #09090b;

  /* Hairline Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.11);
  --border-accent: rgba(255, 255, 255, 0.22);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-focus: rgba(255, 255, 255, 0.45);
  --hairline-top: rgba(255, 255, 255, 0.08);

  /* Typography */
  --text-main: #fafafa;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;

  /* Semantic Status ONLY */
  --status-success: #22c55e;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #e4e4e7;

  /* Spacing Scale */
  --space-2xs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;

  /* Typography Scale */
  --font-xs: 11px;
  --font-sm: 12px;
  --font-md: 13px;
  --font-base: 14px;
  --font-lg: 16px;
  --font-xl: 20px;

  /* Radius Scale */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  /* Shadows & Motion */
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --shadow-float: 0 24px 60px -18px rgba(0, 0, 0, 0.85), 0 2px 10px rgba(0, 0, 0, 0.35);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ios-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ios-fluid: cubic-bezier(0.32, 0.72, 0, 1);
  --ios-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-datetime-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--font-sm);
  outline: none;
  color-scheme: dark;
  margin-top: 6px;
}
.custom-datetime-input:focus {
  border-color: var(--border-focus);
}

.btn-add-ch-glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(184, 142, 74, 0.08) 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-radius: 20px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-add-ch-glass:hover, .btn-add-ch-glass:active {
  transform: scale(0.97);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0%, rgba(184, 142, 74, 0.18) 100%);
  border-color: #ffffff;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.3);
}
.add-ch-option-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 13px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}
.add-ch-option-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
}
.add-ch-option-header {
  display: flex;
  align-items: center;
  gap: 9px;
}
.add-ch-option-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
/* ------------------------------------------------------------- */
/*   CLEAN RE-DESIGNED TIMING CARDS (ANTI-MUSH)                 */
/* ------------------------------------------------------------- */
.clean-section-card {
  background: linear-gradient(160deg, rgba(25, 25, 28, 0.72) 0%, rgba(17, 17, 19, 0.82) 100%);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}
.clean-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.clean-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.clean-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.clean-card-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.setting-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}
.setting-val-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 6px;
}
.setting-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 14px 0;
}
.pill-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  width: 100%;
}
.pill-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  width: 100%;
}
@media (max-width: 360px) {
  .pill-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.pill-btn {
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: all 0.16s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pill-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--border-medium);
  color: var(--text-main);
}
.pill-btn.active {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}
.pill-btn.span-2 {
  grid-column: span 2;
}
.compact-input-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
}
.compact-num-input {
  width: 56px;
  min-height: 40px;
  padding: 6px 4px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.compact-unit-select {
  min-height: 40px;
  padding: 6px 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

/* ------------------------------------------------------------- */
/*   2. RESET & BASE LAYOUT                                     */
/* ------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  width: 100%;
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #0a0a0b;
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255, 255, 255, 0.09), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 35%, rgba(207, 201, 189, 0.05), transparent 70%),
    radial-gradient(ellipse 60% 40% at 10% 75%, rgba(255, 255, 255, 0.04), transparent 70%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-main);
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  font-size: var(--font-base);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: calc(132px + env(safe-area-inset-bottom, 12px));
  -webkit-font-smoothing: antialiased;
}

/* Tactile Press Effects */
button, .scenario-card, .channel-row, .chip-timing, .tg-modal-post,
.tpl-item-card, .btn-choose-post-trigger, .nav-tab-btn, .tool-btn {
  transition: transform 0.16s var(--ios-fluid), box-shadow 0.2s var(--ios-fluid), background 0.2s var(--ios-fluid), border-color 0.2s var(--ios-fluid);
  will-change: transform;
}
button:active, .scenario-card:active, .channel-row:active, .chip-timing:active,
.btn-choose-post-trigger:active, .nav-tab-btn:active, .tool-btn:active {
  transform: scale(0.96);
}

.btn:focus-visible,.segment-btn:focus-visible,.dock-tab-btn:focus-visible,.pill-btn:focus-visible,.tool-btn:focus-visible,.btn-post-action:focus-visible,.ux-icon-btn:focus-visible{outline:2px solid var(--accent-primary);outline-offset:2px;}

/* ------------------------------------------------------------- */
/*   3. TOP HEADER & NAVIGATION                                 */
/* ------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 11px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(12, 12, 13, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  width: 100%;
}
.brand-group {
  min-width: 0;
}
.brand-group h1 {
  font-size: var(--font-lg);
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 10%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.4px;
  line-height: 1.2;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.2));
}
.brand-group p {
  font-size: var(--font-xs);
  color: #a3a09a;
  font-weight: 500;
  letter-spacing: -0.1px;
}
.system-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.status-dot {
  width: 6px;
  height: 6px;
  background-color: #34d399;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.8);
  animation: applePulse 2.4s infinite ease-in-out;
}
@keyframes applePulse {
  0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px rgba(52, 211, 153, 0.8); }
  50% { opacity: 0.45; transform: scale(0.85); box-shadow: 0 0 2px rgba(52, 211, 153, 0.4); }
}

/* Navigation Tabs */
/* ==========================================
   PREMIUM BOTTOM NAVIGATION DOCK (iOS Style)
   ========================================== */
.app-bottom-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 95;
  padding: 6px 14px calc(6px + env(safe-area-inset-bottom, 8px));
  background: linear-gradient(180deg, rgba(10, 10, 11, 0) 0%, rgba(10, 10, 11, 0.75) 45%, rgba(10, 10, 11, 0.96) 100%);
  pointer-events: none;
}
.dock-inner {
  pointer-events: auto;
  max-width: 440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 4px;
  background: rgba(21, 21, 24, 0.82);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  padding: 5px 6px;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.dock-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 4px;
  background: transparent;
  border: none;
  border-radius: 14px;
  color: #8e8b85;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}
.dock-tab-btn:active {
  transform: scale(0.92);
}
.dock-tab-btn .dock-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  transition: all 0.2s ease;
}
.dock-tab-btn .dock-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.1px;
  color: inherit;
  transition: color 0.2s ease;
}
.dock-tab-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.dock-tab-btn.active .dock-icon {
  color: #ffffff;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.45));
}
.dock-tab-btn.active .dock-label {
  color: #ffffff;
  font-weight: 700;
}

/* Approve pill inside channel card */
.btn-approve-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(184, 142, 74, 0.25) 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.15);
}
.btn-approve-pill:active {
  transform: scale(0.95);
  background: var(--accent-primary);
  color: #000;
}
.btn-approve-pill .count-badge {
  background: var(--accent-primary);
  color: #000;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
}
.badge-zero {
  font-size: 12px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Wizard Step Progress Bar */
.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(19, 19, 22, 0.5);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
}
.wizard-step-node {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  min-width: 0;
  flex-shrink: 0;
}
.wizard-step-node.active {
  color: var(--accent-primary);
}
.wizard-step-node.completed {
  color: var(--status-success);
}
.wizard-step-node span {
  white-space: nowrap;
}
@media (max-width: 360px) {
  .wizard-step-node span {
    font-size: 11px;
  }
}
.step-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.3s var(--ios-spring);
  flex-shrink: 0;
}
.wizard-step-node.active .step-circle {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  color: #09090b;
  box-shadow: 0 0 10px var(--accent-glow);
  transform: scale(1.12);
}
.wizard-step-node.completed .step-circle {
  background: var(--status-success);
  border-color: var(--status-success);
  color: #09090b;
}
.wizard-step-line {
  flex: 1;
  height: 2px;
  background: var(--border-subtle);
  margin: 0 8px;
  min-width: 10px;
  transition: background 0.3s var(--ios-fluid);
}
.wizard-step-line.completed {
  background: var(--status-success);
}

/* ------------------------------------------------------------- */
/*   4. MAIN VIEWPORT & STEP CONTAINERS                         */
/* ------------------------------------------------------------- */
.container {
  padding: 14px 16px calc(146px + env(safe-area-inset-bottom, 0px));
  flex: 1;
  max-width: 580px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
@media (max-width: 360px) {
  .container {
    padding: 12px 12px calc(146px + env(safe-area-inset-bottom, 0px));
  }
}

.section-title-wrap {
  margin-bottom: 12px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}
.section-subtitle {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

/* Smooth Slide Transitions */
.step-slide-in-right {
  animation: iosStepInRight 0.34s var(--ios-fluid) forwards;
}
.step-slide-in-left {
  animation: iosStepInLeft 0.34s var(--ios-fluid) forwards;
}
@keyframes iosStepInRight {
  0% { opacity: 0; transform: translateX(24px) scale(0.98); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes iosStepInLeft {
  0% { opacity: 0; transform: translateX(-24px) scale(0.98); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes iosCardAppear {
  0% { opacity: 0; transform: translateY(12px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.ios-item-appear {
  animation: iosCardAppear 0.3s var(--ios-fluid) both;
}

/* ------------------------------------------------------------- */
/*   5. STEP 1: SCENARIOS & CHANNELS                            */
/* ------------------------------------------------------------- */
.scenarios-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}
.scenario-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  min-width: 0;
}
.scenario-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}
.scenario-card.active {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.12);
}
.scenario-icon {
  font-size: 18px;
  margin-bottom: 4px;
  line-height: 1;
}
.scenario-name {
  font-size: var(--font-xs);
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 2px;
}
.scenario-desc {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Channels List */
.channels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.channels-title {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.channels-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-subtle);
  padding: 2px 7px;
  border-radius: 12px;
}
.search-input-wrap {
  position: relative;
  margin-bottom: 10px;
  min-width: 0;
}
#viewCreate, #viewBots {
  overflow-x: hidden;
  min-width: 0;
  max-width: 100%;
}
.search-input {
  width: 100%;
  min-height: 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px 10px 34px;
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus {
  border-color: var(--accent-primary);
}
.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 12px;
  pointer-events: none;
}
.channels-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 8px;
}

#wizardStep1, #wizardStep2, #wizardStep3 {
  padding-bottom: 12px;
}
.channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  min-width: 0;
}
.channel-row:hover {
  border-color: var(--border-hover);
}
.channel-row.selected {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
}
.channel-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 750;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.channel-meta {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}
.channel-title {
  font-size: var(--font-md);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.3;
}
.channel-subtitle {
  font-size: var(--font-xs);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.channel-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  flex-shrink: 0;
  margin-left: 8px;
}
.channel-row.selected .channel-check {
  background: var(--accent-gradient);
  border-color: var(--accent-primary);
  color: #09090b;
  font-weight: 900;
}

/* ------------------------------------------------------------- */
/*   6. STEP 2: CONTENT STUDIO & MESSAGES                       */
/* ------------------------------------------------------------- */
.templates-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.btn-template-bar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
  min-width: 0;
}
.btn-template-bar:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.btn-template-bar.save {
  background: var(--accent-subtle);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--accent-primary);
}
.btn-template-bar span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.template-badge-chip {
  background: var(--accent-primary);
  color: #09090b;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 10px;
  flex-shrink: 0;
}

/* Reply Target Picker */
.reply-target-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 14px;
}
.reply-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.reply-card-title {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-choose-post-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 14px;
  background: var(--accent-subtle);
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius-md);
  color: var(--accent-primary);
  font-size: var(--font-sm);
  font-weight: 700;
  cursor: pointer;
}
.tg-quote-selected {
  display: flex;
  align-items: stretch;
  background: rgba(21, 21, 24, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 4px;
}
.tg-quote-accent-bar {
  width: 4px;
  background: var(--accent-primary);
  flex-shrink: 0;
}
.tg-quote-content {
  flex: 1;
  padding: 8px 10px;
  min-width: 0;
}
.tg-quote-author {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--accent-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg-quote-snippet {
  font-size: var(--font-sm);
  color: #e8e5df;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tg-quote-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  flex-shrink: 0;
}
.btn-quote-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.btn-quote-action.danger {
  color: var(--status-danger);
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

/* Message Cards */
.message-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  position: relative;
}
.message-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.message-card-badge {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-delete-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--status-danger);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Compact HTML Toolbar */
.html-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 8px;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tool-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-btn:hover {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.form-textarea {
  width: 100%;
  min-height: 85px;
  max-height: 220px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: var(--font-md);
  line-height: 1.4;
  outline: none;
  resize: vertical;
}
.form-textarea:focus {
  border-color: var(--accent-primary);
}

/* Media Upload */
.media-box {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.btn-upload-media {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.media-preview-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--status-success);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
}

/* Stacked Inline Buttons Builder */
.buttons-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}
.buttons-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.buttons-title {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-add-inline {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.inline-btn-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.inline-btn-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.inline-btn-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-del-inline-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--status-danger);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}
.inline-btn-inputs {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}
.inline-btn-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 6px 8px;
  color: var(--text-main);
  font-size: var(--font-sm);
  outline: none;
}
.inline-btn-input:focus {
  border-color: var(--accent-primary);
}

.btn-add-another-msg {
  width: 100%;
  min-height: 44px;
  background: var(--accent-subtle);
  border: 1px dashed var(--accent-primary);
  color: var(--accent-primary);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

/* ------------------------------------------------------------- */
/*   7. STEP 3: TIMING & LAUNCH                                 */
/* ------------------------------------------------------------- */
.timing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}
.timing-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.timing-block:last-child {
  margin-bottom: 0;
}
.timing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.timing-title {
  font-size: var(--font-md);
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.timing-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.timing-number-input {
  width: 65px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  color: var(--text-main);
  font-size: var(--font-md);
  font-weight: 700;
  text-align: center;
  outline: none;
}
.timing-unit-select {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 5px 6px;
  color: var(--text-muted);
  font-size: var(--font-sm);
  outline: none;
}
.chips-row {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.chips-row::-webkit-scrollbar {
  display: none;
}
.chip-timing {
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.chip-timing.active {
  background: var(--accent-subtle);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

/* Live Preview */
.preview-header-label {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.tg-sim-bubble {
  background: #1d1d20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px;
  position: relative;
}
.tg-sim-reply-quote {
  border-left: 3px solid var(--accent-primary);
  padding-left: 8px;
  margin-bottom: 8px;
  font-size: var(--font-sm);
  line-height: 1.35;
  overflow: hidden;
}
.tg-sim-photo {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: none;
  object-fit: cover;
  width: 100%;
}
.tg-sim-text {
  font-size: var(--font-md);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  color: #e8e5df;
}
.tg-sim-buttons {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tg-sim-btn {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 7px;
  text-align: center;
  font-size: var(--font-sm);
  font-weight: 600;
  color: #fff;
}

/* ------------------------------------------------------------- */
/*   8. FIXED FOOTER (SAFE-AREA & OVERFLOW SAFE)                */
/* ------------------------------------------------------------- */
.step-footer {
  position: fixed;
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  left: 0;
  right: 0;
  padding: 8px 16px 6px;
  z-index: 93;
  pointer-events: none;
  width: 100%;
  background: linear-gradient(180deg, rgba(9, 9, 11, 0) 0%, rgba(9, 9, 11, 0.85) 55%, rgba(9, 9, 11, 0.96) 100%);
}
.step-footer-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  pointer-events: auto;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
.btn-step-back {
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: var(--font-md);
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-step-next {
  flex: 1;
  padding: 12px 18px;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #09090b;
  font-size: var(--font-md);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.btn-step-next::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -80%;
  width: 50%;
  height: 220%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  animation: iosShimmer 4.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
@keyframes iosShimmer {
  0% { left: -80%; }
  30%, 100% { left: 150%; }
}
.btn-step-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* ------------------------------------------------------------- */
/*   9. MODAL BOTTOM SHEETS (INDEPENDENT SCROLL & SAFE-AREA)    */
/* ------------------------------------------------------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  width: 100%;
}
.sheet-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.sheet-card {
  width: 100%;
  max-width: 540px;
  max-height: min(85dvh, 85vh);
  height: 75vh;
  background: #141416;
  border: 1px solid var(--border-medium);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform 0.34s var(--ios-fluid);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.75);
}
.sheet-backdrop.active .sheet-card {
  transform: translateY(0);
}
.sheet-drag-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 8px auto 4px auto;
  flex-shrink: 0;
}
.sheet-top {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.sheet-sub {
  font-size: var(--font-xs);
  color: var(--text-dim);
}
.sheet-close-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sheet-search-wrap {
  padding: 8px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.sheet-content-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 20px));
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Telegram Channel Post Bubble in Modal */
.tg-modal-post {
  background: #1d1d20;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
}
.tg-modal-post:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}
.tg-modal-post.selected {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}
.tg-modal-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.tg-modal-post-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  background: var(--accent-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}
.tg-modal-post-date {
  font-size: 11px;
  color: var(--text-dim);
}
.tg-modal-post-body {
  font-size: var(--font-md);
  line-height: 1.4;
  color: #e8e5df;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
}
.tg-modal-post-media {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #ffffff;
  background: rgba(227, 200, 143, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

/* Template Card in Modal */
.tpl-item-card {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tpl-item-card:hover {
  border-color: var(--accent-primary);
}
.tpl-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tpl-item-name {
  font-size: var(--font-md);
  font-weight: 700;
  color: #fff;
}
.tpl-item-meta {
  font-size: var(--font-xs);
  color: var(--text-dim);
}
.tpl-item-preview {
  font-size: var(--font-sm);
  color: var(--text-muted);
  line-height: 1.35;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 8px;
  border-radius: 5px;
  max-height: 48px;
  overflow: hidden;
  word-break: break-word;
}
.tpl-item-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.btn-apply-tpl {
  flex: 1;
  background: var(--accent-gradient);
  border: none;
  color: #09090b;
  font-size: var(--font-sm);
  font-weight: 700;
  padding: 7px;
  border-radius: 6px;
  cursor: pointer;
}
.btn-del-tpl {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--status-danger);
  font-size: var(--font-sm);
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* ------------------------------------------------------------- */
/*   10. ACTIVE TASKS VIEW                                      */
/* ------------------------------------------------------------- */
.active-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.active-post-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.post-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.post-status-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.post-status-pill.running {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-success);
}
.post-status-pill.paused {
  background: rgba(245, 158, 11, 0.15);
  color: var(--status-warning);
}
.post-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.btn-post-action {
  flex: 1;
  padding: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: var(--font-sm);
  font-weight: 600;
  cursor: pointer;
}
.btn-post-action.danger {
  color: var(--status-danger);
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
}

/* Dynamic Island Toast */
.app-toast {
  position: fixed;
  top: 16px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-65px) scale(0.85);
  background: rgba(21, 21, 24, 0.95);
  backdrop-filter: blur(25px) saturate(190%);
  -webkit-backdrop-filter: blur(25px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: var(--font-sm);
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 30px;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.38s var(--ios-spring), opacity 0.25s ease;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  width: auto;
  max-width: 90vw;
  height: auto;
}
.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Conflict Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  width: 100%;
}
.modal-card {
  background: linear-gradient(165deg, rgba(24, 24, 27, 0.96) 0%, rgba(14, 14, 16, 0.98) 100%);
  backdrop-filter: blur(32px) saturate(180%);
  -webkit-backdrop-filter: blur(32px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 22px;
  padding: 20px;
  width: 100%;
  max-width: 400px;
  box-sizing: border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: appleCardIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   AUDIENCE & ANALYTICS STYLES
   ========================================= */
    .audience-segmented-bar {
  display: flex;
  background: rgba(19, 19, 21, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
}
.segment-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 600;
  color: #8e8b85;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-tap-highlight-color: transparent;
}
.segment-btn:active {
  transform: scale(0.96);
}
.segment-btn.active {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.subtab-content {
  animation: iosFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes iosFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.segment-badge {
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  background: rgba(227, 194, 127, 0.2);
  color: #e3c27f;
}

/* Channel Selector Bar */
.audience-ch-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 14px 2px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.audience-ch-scroll::-webkit-scrollbar { display: none; }

.audience-ch-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.audience-ch-card:active {
  transform: scale(0.96);
}
.audience-ch-card.active {
  background: rgba(227, 194, 127, 0.1);
  border-color: rgba(227, 194, 127, 0.4);
  color: #fff;
  box-shadow: 0 0 16px rgba(227, 194, 127, 0.15);
}
.audience-ch-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e3c27f, #d4d4d8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.audience-ch-title {
  font-size: 13px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* KPI Grid */
.audit-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}
.audit-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
}
.audit-kpi-label {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  margin-bottom: 4px;
}
.audit-kpi-val {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.audit-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Gender Split Bar */
.gender-bar-wrap {
  margin: 14px 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
}
.gender-track {
  height: 10px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  display: flex;
  margin: 8px 0;
}
.gender-male-fill {
  background: linear-gradient(90deg, #d4d4d8, #e3c27f);
  transition: width 0.5s ease;
}
.gender-female-fill {
  background: linear-gradient(90deg, #b9796a, #ef6b6b);
  transition: width 0.5s ease;
}

/* Activity Breakdown */
.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 9px;
  font-size: 12px;
}
.activity-bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 12px;
  overflow: hidden;
}
.activity-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width 0.5s ease;
}

/* Languages Grid */
.lang-chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}
.lang-chip {
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

/* Pulse Scanner */
.audit-scanning-card {
  text-align: center;
  padding: 36px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(227, 194, 127, 0.2);
}
.audit-pulse-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #e3c27f;
  border: 3px solid rgba(227, 194, 127, 0.2);
  border-top-color: #e3c27f;
  animation: spinAudit 1.2s linear infinite;
  box-shadow: 0 0 25px rgba(227, 194, 127, 0.2);
}
@keyframes spinAudit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Links Cards */
.link-item-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  transition: all 0.2s;
}
.link-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.link-item-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}
.link-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin: 8px 0;
  font-size: 12px;
}


/* =========================================================================
   🤖 BOTS & AUTO-FUNNELS DEDICATED STYLES (MATCHING POSTIK MINI APP DESIGN)
   ========================================================================= */
@keyframes appleCardIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

body.keyboard-open .app-bottom-dock {
  transform: translateY(120%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
#opBotEditorView {
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 24px));
}

/* Apple-Grade Liquid Glass Bot Cards */
.cbot-saas-card {
  background: linear-gradient(160deg, rgba(25, 25, 28, 0.75) 0%, rgba(17, 17, 19, 0.85) 100%);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 14px 15px;
  margin-bottom: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 11px;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, border-color 0.22s ease;
  animation: appleCardIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.cbot-saas-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 18px 18px 0 0;
}
.cbot-saas-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.48), 0 0 20px rgba(255, 255, 255, 0.08);
}
.cbot-saas-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.cbot-saas-title-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.cbot-saas-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}
.cbot-saas-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}
.cbot-saas-user {
  font-size: 12px;
  color: #a3a09a;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease;
}
.cbot-saas-user:hover {
  color: #ffffff;
}
.cbot-saas-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  width: fit-content;
}
.badge-privetka {
  background: rgba(207, 201, 189, 0.12);
  color: #e4dfd4;
  border: 1px solid rgba(207, 201, 189, 0.28);
  box-shadow: 0 0 10px rgba(207, 201, 189, 0.12);
}
.badge-opbot {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}
.cbot-saas-status-col {
  flex-shrink: 0;
}
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.badge-status-active {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.15);
}
.badge-status-paused {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}
.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dot-green {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
  animation: applePulse 2.4s infinite ease-in-out;
}
.dot-amber { background: #fbbf24; }

.cbot-saas-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.cbot-saas-stat-item {
  background: rgba(14, 14, 16, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}
.cbot-saas-stat-num {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.cbot-saas-stat-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.cbot-saas-stat-item {
  min-width: 0;
}
body.in-cbot-editor header.app-header,
body.in-cbot-editor .app-header,
body.in-cbot-editor .dock-nav,
body.in-cbot-editor #dockContainer,
body.in-cbot-editor .app-bottom-dock,
body.in-cbot-editor #appBottomDock,
body:has(#opBotEditorView:not([style*="display: none"])) header.app-header,
body:has(#opBotEditorView:not([style*="display: none"])) .app-header,
body:has(#opBotEditorView:not([style*="display: none"])) .app-bottom-dock,
body:has(#opBotEditorView:not([style*="display: none"])) #appBottomDock {
  display: none !important;
}
.dojim-preset-btn.active {
  background: linear-gradient(135deg, #ffffff 0%, #d4d4d8 100%);
  color: #0c0c0e;
  font-weight: 800;
  border-color: #ffffff;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.35);
}
#opBotEditorView {
  padding-top: 0;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 24px));
}
.cbot-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}
.cbot-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #a3a09a);
  display: block;
  line-height: 1.3;
  letter-spacing: 0.2px;
}
.cbot-input, .cbot-textarea, .post-textarea {
  width: 100%;
  background: var(--bg-input, #0a0a0b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text-main, #f4f2ee);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.cbot-input:focus, .cbot-textarea:focus, .post-textarea:focus {
  border-color: var(--accent-primary, #ffffff);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.25);
}
.cbot-textarea, textarea.post-textarea {
  resize: vertical;
  min-height: 80px;
}
input.post-textarea, input.cbot-input {
  min-height: 40px;
}

.cbot-num-input {
  background: var(--bg-input, #0a0a0b);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 8px;
  color: #fff;
  text-align: center;
  font-weight: 600;
  padding: 6px 8px;
  outline: none;
  box-sizing: border-box;
}
.cbot-num-input:focus {
  border-color: var(--accent-primary, #ffffff);
}

.cbot-btn-primary, .btn-conflict-action.confirm {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--accent-gradient, linear-gradient(135deg, #ffffff 0%, #d4d4d8 100%));
  color: #09090b;
  font-weight: 700;
  font-size: 13px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.25);
  transition: transform 0.15s, opacity 0.15s;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.cbot-btn-primary:active, .btn-conflict-action.confirm:active {
  transform: scale(0.98);
  opacity: 0.9;
}

.cbot-btn-secondary, .btn-conflict-action.cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  color: var(--text-muted, #a3a09a);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
.cbot-btn-secondary:active, .btn-conflict-action.cancel:active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.cbot-upload-btn {
  padding: 0 14px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.cbot-upload-btn:active {
  background: rgba(255, 255, 255, 0.14);
}

  
/* ============================================================= */
/*   ULTRA-PREMIUM LIQUID GLASS TOUCH FEEDBACK (NO BLEED)       */
/* ============================================================= */
.liquid-touch-host {
  position: relative;
  overflow: hidden;
}

/* All target interactive elements automatically clip their ripple */
.chip-timing,
.scenario-card,
.channel-row,
.btn-primary-action,
.btn-secondary-action,
.btn-step-next,
.btn-step-back,
.btn-add-ch-glass,
.btn-approve-pill,
.cbot-btn-primary,
.cbot-btn-secondary,
.cbot-filter-chip,
.tool-btn,
.btn-template-bar,
.btn-quote-action,
.btn-preset-chip {
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.16s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

/* Subtle Apple-style press depression */
.chip-timing:active,
.btn-approve-pill:active,
.btn-add-ch-glass:active,
.cbot-filter-chip:active {
  transform: scale(0.96);
}
.scenario-card:active,
.channel-row:active {
  transform: scale(0.985);
}
.btn-primary-action:active,
.btn-step-next:active {
  transform: scale(0.98);
}

/* Native Dock Tabs: STRICTLY NO RINGS, ONLY PURE TACTILE BOUNCE */
.dock-tab-btn {
  position: relative;
  overflow: visible;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-tap-highlight-color: transparent;
}
.dock-tab-btn:active {
  transform: scale(0.9);
}
.dock-tab-btn:active .dock-icon {
  transform: scale(1.1);
  transition: transform 0.15s ease;
}

/* Liquid Glass Ripple element */
.liquid-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10;
  transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.08) 45%, transparent 72%);
  animation: liquidRippleSpread 0.38s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  mix-blend-mode: screen;
}

/* Tinted variations for primary cyan and emerald */
.liquid-ripple.cyan {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.12) 48%, transparent 72%);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}
.liquid-ripple.emerald {
  background: radial-gradient(circle, rgba(16, 185, 129, 0.4) 0%, rgba(16, 185, 129, 0.14) 48%, transparent 72%);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

@keyframes liquidRippleSpread {
  0% {
    transform: translate(-50%, -50%) scale(0.08);
    opacity: 0.9;
  }
  50% {
    opacity: 0.55;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

/* ============================================================= */
/*   LUXURY MINIMALIST LAUNCH HERO SEQUENCE                     */
/* ============================================================= */
.launch-hero-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(9, 9, 10, 0.78);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.launch-hero-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.launch-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 30px 24px;
  max-width: 300px;
  background: rgba(21, 21, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(255, 255, 255, 0.18);
  transform: scale(0.9) translateY(12px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.launch-hero-overlay.active .launch-hero-card {
  transform: scale(1) translateY(0);
}
.launch-hero-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(184, 142, 74, 0.25) 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 16px;
  position: relative;
}
.launch-hero-title {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.launch-hero-desc {
  font-size: 13px;
  color: #a3a09a;
  line-height: 1.4;
}

/* Elegant drawing checkmark */
.accept-checkmark-svg {
  width: 48px;
  height: 48px;
  stroke: #10b981;
  stroke-width: 3.5;
  stroke-miterlimit: 10;
  border-radius: 50%;
}
.accept-checkmark-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3.5;
  stroke: #10b981;
  fill: none;
  animation: acceptStroke 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.accept-checkmark-check {
  transform-origin: 50% 50%;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: acceptStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.4s forwards;
}
@keyframes acceptStroke {
  100% {
    stroke-dashoffset: 0;
  }
}

/* Beacon Highlight for newly created tasks in list */
.beacon-highlight {
  animation: taskBeaconGlow 2.4s ease-out 1;
}
@keyframes taskBeaconGlow {
  0% {
    border-color: #ffffff;
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.55);
    transform: scale(1.015);
  }
  70% {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
    transform: scale(1);
  }
  100% {
    border-color: var(--border-subtle);
    box-shadow: none;
  }
}


/* === Noir & Champagne v2 Layer === */

html { background: var(--bg-base); }
body {
  background-color: var(--bg-base);
  background-image:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.10) 0%, rgba(255, 255, 255, 0.03) 35%, transparent 62%),
    radial-gradient(80% 50% at 100% 100%, rgba(255, 255, 255, 0.025), transparent 60%);
  background-attachment: scroll;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
  font-feature-settings: "ss01", "cv11", "tnum" 0;
  letter-spacing: -0.006em;
  color: var(--text-main);
  text-rendering: optimizeLegibility;
}
button, input, select, textarea {
  font-family: inherit;
}
::selection { background: rgba(255, 255, 255, 0.3); color: #fff; }
b, strong { font-weight: 700; }
.mono, code, kbd { font-family: 'JetBrains Mono', ui-monospace, monospace; }

/* ---------- Header ---------- */
.app-header {
  height: 52px;
  padding: 8px 16px;
  background: rgba(9, 9, 11, 0.84);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
}
.brand-group { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  position: relative;
  width: 34px; height: 34px; border-radius: 11px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, rgba(239, 208, 146, 0.22), rgba(21, 19, 16, 0.96));
  border: 1px solid rgba(217, 180, 108, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 6px 18px -6px rgba(217, 180, 108, 0.42);
  color: #efd092;
  overflow: hidden;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 244, 214, 0.28) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: postikLogoSweep 4.8s ease-in-out infinite;
  pointer-events: none;
}
.brand-mark .logo-svg { width: 22px; height: 22px; overflow: visible; position: relative; z-index: 1; }
.brand-mark .logo-plane { transform-origin: 14px 14px; animation: postikPlaneFloat 3.6s ease-in-out infinite; }
.brand-mark .logo-trail-1 { animation: postikTrailPulse 2.4s ease-in-out infinite; }
.brand-mark .logo-trail-2 { animation: postikTrailPulse 2.4s ease-in-out 0.45s infinite; }
.brand-mark .logo-spark { transform-origin: 22.8px 5.8px; animation: postikSparkPulse 2.8s ease-in-out infinite; }
.brand-text { display: flex; flex-direction: column; justify-content: center; gap: 1px; }
.brand-group h1 {
  font-size: 16px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.05;
  background: linear-gradient(110deg, #fafafa 32%, #f5dfb2 50%, #fafafa 68%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fafafa;
  animation: postikTextShimmer 6s ease-in-out infinite;
  filter: none;
}
.brand-group p {
  display: none;
}
.system-status {
  gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.01em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.system-status .status-dot { background: #71717a; box-shadow: none; animation: none; }
.system-status.is-active { color: #e4e4e7; border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); }
.system-status.is-active .status-dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); animation: none; }
.system-status.sub-warning { color: #fbbf24; border-color: rgba(245, 158, 11, 0.25); background: rgba(245, 158, 11, 0.08); }
.system-status.sub-warning .status-dot { background: var(--status-warning); }
.system-status.is-error { color: #f87171; border-color: rgba(239, 68, 68, 0.25); background: rgba(239, 68, 68, 0.08); }
.system-status.is-error .status-dot { background: var(--status-danger); }
@keyframes applePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

#subWarningBanner {
  border-radius: 12px; margin: 10px 16px 0; padding: 10px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2); color: #fde68a; font-size: 12.5px;
}

/* ---------- Wizard progress ---------- */
.wizard-progress {
  position: sticky;
  top: 52px;
  z-index: 88;
  padding: 9px 16px;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.wizard-step-node { font-size: 12px; font-weight: 600; color: var(--text-dim); gap: 7px; }
.wizard-step-node.active { color: #fafafa; font-weight: 650; }
.wizard-step-node.completed { color: #a1a1aa; }
.step-circle {
  width: 20px; height: 20px; font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--text-dim);
  transform: none;
}
.wizard-step-node.active .step-circle {
  background: linear-gradient(135deg, #f3dcab 0%, #d9b46c 100%);
  border-color: rgba(255, 255, 255, 0.4);
  color: #09090b;
  box-shadow: 0 0 14px -2px rgba(217, 180, 108, 0.5);
  transform: none;
}
.wizard-step-node.completed .step-circle { background: rgba(34, 197, 94, 0.16); border-color: rgba(34, 197, 94, 0.4); color: #4ade80; transform: none; }
.wizard-step-line { height: 1px; background: rgba(255, 255, 255, 0.08); margin: 0 10px; }
.wizard-step-line.completed { background: rgba(34, 197, 94, 0.45); }

/* ---------- Typography ---------- */
.section-title-wrap { margin: 2px 0 14px; }
.section-title, .bots-hub-title {
  font-size: 20px; font-weight: 700; color: #fafafa; letter-spacing: -0.03em; line-height: 1.2;
}
.section-subtitle, .bots-hub-sub {
  font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.45; font-weight: 400;
}
.eyebrow, .channels-header .label, .section-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-dim);
}

/* ---------- Cards ---------- */
.clean-section-card, .glass-card, .cbot-card, .audit-card, .task-card, .link-card {
  background: #131316;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  box-shadow: none;
}
.clean-section-card { padding: 16px; margin-bottom: 12px; }
.clean-card-header { gap: 12px; margin-bottom: 14px; align-items: center; }
.clean-card-icon {
  width: 36px; height: 36px; border-radius: 10px; font-size: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fafafa;
  box-shadow: none;
}
.clean-card-icon svg, .scenario-icon svg, .ico svg { width: 17px; height: 17px; }
.clean-card-title { font-size: 14.5px; font-weight: 650; letter-spacing: -0.015em; }
.clean-card-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

/* ---------- Scenario cards ---------- */
.scenarios-grid { gap: 8px; margin-bottom: 18px; }
.scenario-card {
  padding: 13px 8px 11px; border-radius: 14px;
  background: #131316;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.scenario-card.active {
  background: #1c1c21;
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: none;
}
.scenario-icon {
  width: 32px; height: 32px; margin: 0 auto 8px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); color: var(--text-muted);
}
.scenario-card.active .scenario-icon { background: #ffffff; border-color: #ffffff; color: #09090b; }
.scenario-name { font-size: 11.5px; font-weight: 650; letter-spacing: -0.015em; color: #fafafa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scenario-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* ---------- Inputs ---------- */
.search-input, input[type="text"], input[type="number"], input[type="url"], input[type="datetime-local"], textarea, select, .custom-datetime-input {
  font-family: inherit;
}
.search-input, .custom-datetime-input {
  background: #131316;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-main);
  transition: border-color .18s ease, background .18s ease;
}
.search-input:focus, .custom-datetime-input:focus, textarea:focus {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
  background: #18181b;
  outline: none;
}
::placeholder { color: #52525b; opacity: 1; }
input[type="checkbox"], input[type="radio"] { accent-color: #ffffff; }

/* ---------- Channel rows ---------- */
.channel-row {
  background: #131316; border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px; padding: 12px 14px;
}
.channel-row.selected, .channel-row.active {
  border-color: rgba(255, 255, 255, 0.28);
  background: #1b1b20;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 18px; border-radius: 12px;
  font-family: inherit; font-size: 14px; font-weight: 650; letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease-out), background .18s ease, opacity .18s ease;
}
.btn-primary, .btn-step-next, .cbot-btn-primary {
  background: linear-gradient(180deg, #f3dcab 0%, #d9b46c 100%);
  color: #09090b;
  border: 1px solid rgba(255, 240, 200, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 22px -10px rgba(217, 180, 108, 0.55);
  font-weight: 700;
  text-shadow: none;
}
.btn-primary:active, .btn-step-next:active, .cbot-btn-primary:active {
  transform: scale(0.985);
  background: linear-gradient(180deg, #e7cc94 0%, #c8a258 100%);
}
.btn-step-next { border-radius: 13px; padding: 13px 18px; font-size: 14px; min-height: 48px; }
.btn-primary:disabled, .btn-step-next:disabled, .btn-step-next.disabled, .btn-step-next[disabled] {
  background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.06); box-shadow: none; text-shadow: none; cursor: not-allowed;
}
.btn-secondary, .btn-step-back, .cbot-btn-secondary {
  background: rgba(255, 255, 255, 0.06); color: #fafafa;
  border: 1px solid rgba(255, 255, 255, 0.09); box-shadow: none;
}
.btn-step-back { border-radius: 13px; min-height: 48px; }
.btn-add-ch-glass, .btn-approve-pill {
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fafafa; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  letter-spacing: 0;
}
.btn-approve-pill .count-badge { background: #ffffff; color: #09090b; }
.tool-btn { border-radius: 10px; }

/* ---------- Pills & segmented controls ---------- */
.pill-btn {
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-muted); border-radius: 10px; font-weight: 600;
}
.pill-btn.active {
  color: #09090b; border-color: #ffffff;
  background: #ffffff;
  box-shadow: none;
}
.audience-segmented-bar, .segment-tabs, #botsHubMainTabs {
  background: #131316;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px; padding: 3px; gap: 3px;
  box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.segment-btn {
  color: var(--text-muted); background: transparent;
  border: 1px solid transparent; border-radius: 9px;
  font-weight: 600; letter-spacing: -0.005em; box-shadow: none;
}
.segment-btn.active {
  color: #fafafa;
  background: #27272a;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
.segment-btn.active::after { display: none !important; }
.segment-badge {
  background: rgba(255, 255, 255, 0.12); color: #fafafa;
  border-radius: 999px; font-size: 11px; padding: 1px 7px;
}
.setting-val-badge { border-radius: 999px; font-weight: 650; letter-spacing: 0.01em; }

/* ---------- Bottom dock ---------- */
.app-bottom-dock {
  padding: 6px 12px calc(8px + env(safe-area-inset-bottom, 6px));
  background: linear-gradient(180deg, rgba(9, 9, 11, 0) 0%, rgba(9, 9, 11, 0.92) 45%, rgba(9, 9, 11, 0.99) 100%);
}
.dock-inner {
  background: rgba(20, 20, 23, 0.88);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px; padding: 4px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}
.dock-tab-btn { color: #71717a; border-radius: 13px; padding: 6px 2px 5px; gap: 3px; }
.dock-tab-btn .dock-label { font-size: 10.5px; font-weight: 600; letter-spacing: -0.005em; }
.dock-tab-btn.active { color: #fafafa; background: rgba(255, 255, 255, 0.09); }
.dock-tab-btn.active .dock-icon { color: #fafafa; filter: none; }
.dock-tab-btn.active .dock-label { color: #fafafa; font-weight: 700; }

/* ---------- Sheets & modals ---------- */
.sheet-backdrop, .modal-backdrop { background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sheet-card {
  background: #131316;
  border: 1px solid rgba(255, 255, 255, 0.09); border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.75);
}
.sheet-drag-handle { background: rgba(255, 255, 255, 0.16); width: 36px; height: 4px; border-radius: 4px; }
.sheet-title { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.sheet-sub { color: var(--text-muted); font-size: 12.5px; }
.sheet-close-btn {
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); color: var(--text-muted);
}

/* ---------- Toast ---------- */
.app-toast {
  background: rgba(24, 24, 27, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  font-size: 13px; font-weight: 600; padding: 10px 18px; color: #fafafa;
}

/* ---------- Loading ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08); border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

/* ---------- Empty states ---------- */
.empty-state {
  text-align: center; padding: 36px 22px; border-radius: 18px;
  background: #131316;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.empty-state .empty-ico {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; color: var(--gold-200);
  background: linear-gradient(145deg, rgba(255, 255, 255,0.16), rgba(255, 255, 255,0.04));
  border: 1px solid rgba(255, 255, 255, 0.24);
}
.empty-state .empty-ico svg { width: 24px; height: 24px; }
.empty-state h3 { font-size: 16px; font-weight: 800; color: #fff; letter-spacing: -0.02em; margin-bottom: 6px; }
.empty-state p { font-size: 13px; color: var(--text-muted); line-height: 1.5; max-width: 300px; margin: 0 auto; }
.empty-state .btn { margin-top: 18px; }

/* ---------- Auth gate ---------- */
#authGate {
  position: fixed; inset: 0; z-index: 10001; display: none;
  align-items: center; justify-content: center; padding: 28px;
  background: radial-gradient(120% 70% at 50% 0%, rgba(255, 255, 255,0.12), transparent 60%), #0a0a0b;
}
#authGate.visible { display: flex; }
#authGate .gate-card { max-width: 340px; text-align: center; }
#authGate .gate-mark {
  width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center; color: var(--gold-200);
  background: linear-gradient(145deg, #1d1b17, #0f0e0c); border: 1px solid rgba(255, 255, 255,0.4);
  box-shadow: 0 18px 40px -14px rgba(255, 255, 255,0.45), inset 0 1px 0 rgba(255, 255, 255,0.12);
}
#authGate .gate-mark svg { width: 30px; height: 30px; }
#authGate h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; color: #fff; margin-bottom: 10px; }
#authGate p { font-size: 14px; color: var(--text-muted); line-height: 1.55; }
#authGate .btn { margin-top: 24px; width: 100%; }

/* ---------- Misc polish ---------- */
.app-header, .dock-inner, .sheet-card { -webkit-font-smoothing: antialiased; }
hr, .divider { border-color: rgba(255, 255, 255, 0.06); }
a { color: var(--gold-200); }

#authGateLink {
  margin-top: 24px;
  width: 100%;
  text-align: center;
  text-decoration: none;
}

#subWarningBanner {
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* === Universal Dark Theme Select / Dropdown Fix === */
select,
select:focus,
select:active,
select.cbot-input,
select.post-textarea,
select.cbot-select,
select.compact-unit-select,
select.bot-media-type,
.bot-form select {
  color-scheme: dark;
  background-color: var(--bg-elevated, #18181b);
  color: var(--text-main, #f4f2ee);
  border: 1px solid var(--border-medium, rgba(255, 255, 255, 0.13));
  border-radius: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a09a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 34px;
  appearance: none;
  -webkit-appearance: none;
}

select option,
select optgroup,
.post-textarea option,
.cbot-input option,
.cbot-select option,
.compact-unit-select option,
.bot-form select option,
#selBotCheckStyle option,
#selBotDelayTarget option,
#selBotDelayStyle option,
#selMyConnectedChannels option,
#selBotPartnerStyle option,
#inpBotWelcomeMediaType option,
#inpBcMediaType option,
#selStepType option,
#selPrivetkaAddChannel option,
#selPrivetkaLeaveType option,
#selNewSeqTrigger option,
#intervalUnitSelect option,
#deleteUnitSelect option {
  background-color: var(--bg-elevated, #18181b);
  color: var(--text-main, #f4f2ee);
  padding: 10px 14px;
}

select option:checked {
  background-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* === Shared Layout, Typography & Component Utilities === */
.u-row { display: flex; }
.u-row-center { display: flex; align-items: center; }
.u-row-between { display: flex; justify-content: space-between; align-items: center; }
.u-row-between-start { display: flex; justify-content: space-between; align-items: flex-start; }
.u-col { display: flex; flex-direction: column; }
.u-wrap { flex-wrap: wrap; }
.u-flex-1 { flex: 1; min-width: 0; }
.u-flex-1-6 { flex: 1.6; }
.u-min-w-0 { min-width: 0; }
.u-shrink-0 { flex-shrink: 0; }
.u-w-full { width: 100%; }

.u-gap-4 { gap: 4px; }
.u-gap-6 { gap: 6px; }
.u-gap-8 { gap: 8px; }
.u-gap-10 { gap: 10px; }
.u-gap-12 { gap: 12px; }

.u-mt-2 { margin-top: 2px; }
.u-mt-4 { margin-top: 4px; }
.u-mt-6 { margin-top: 6px; }
.u-mt-8 { margin-top: 8px; }
.u-mt-10 { margin-top: 10px; }
.u-mt-12 { margin-top: 12px; }
.u-mt-14 { margin-top: 14px; }
.u-mt-16 { margin-top: 16px; }

.u-mb-0 { margin-bottom: 0; }
.u-mb-2 { margin-bottom: 2px; }
.u-mb-4 { margin-bottom: 4px; }
.u-mb-6 { margin-bottom: 6px; }
.u-mb-8 { margin-bottom: 8px; }
.u-mb-10 { margin-bottom: 10px; }
.u-mb-12 { margin-bottom: 12px; }
.u-mb-14 { margin-bottom: 14px; }
.u-mb-16 { margin-bottom: 16px; }

.u-p-12 { padding: 12px; }
.u-p-14 { padding: 14px; }
.u-p-16 { padding: 16px; }

.u-text-center { text-align: center; }
.u-text-white { color: #ffffff; }
.u-text-main { color: var(--text-main); }
.u-text-muted { color: var(--text-muted); }
.u-text-dim { color: var(--text-dim); }
.u-text-gold { color: var(--accent-primary); }
.u-text-gold-light { color: var(--gold-200); }
.u-text-success { color: var(--status-success); }
.u-text-warning { color: var(--status-warning); }
.u-text-danger { color: var(--status-danger); }
.u-text-info { color: var(--status-info); }

.u-fs-10 { font-size: 10px; }
.u-fs-11 { font-size: 11px; }
.u-fs-12 { font-size: 12px; }
.u-fs-12-5 { font-size: 12.5px; }
.u-fs-13 { font-size: 13px; }
.u-fs-14 { font-size: 14px; }
.u-fs-15 { font-size: 15px; }
.u-fs-16 { font-size: 16px; }

.u-fw-600 { font-weight: 600; }
.u-fw-700 { font-weight: 700; }
.u-fw-800 { font-weight: 800; }
.u-lh-145 { line-height: 1.45; }

.u-min-h-34 { min-height: 34px; }
.u-min-h-36 { min-height: 36px; }
.u-min-h-38 { min-height: 38px; }
.u-min-h-42 { min-height: 42px; }
.u-min-h-70 { min-height: 70px; }

.u-btn-xs { padding: 2px 6px; font-size: 11px; }
.u-btn-xxs { padding: 2px 7px; font-size: 10px; }
.u-btn-sm { padding: 3px 8px; font-size: 11px; }
.u-btn-pad { padding: 2px 8px; }
.u-btn-compact { flex: 1; padding: 6px; font-size: 11px; }
.u-btn-preset { padding: 8px 4px; font-size: 11.5px; text-align: center; border-radius: 8px; }
.u-btn-gold-chip {
  padding: 2px 7px;
  font-size: 11px;
  background: var(--accent-subtle);
  color: var(--accent-primary);
  border: 1px solid var(--border-accent);
  font-weight: 700;
  border-radius: 6px;
}

.u-card-inset {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
}
.u-card-glass-box {
  background: var(--glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
}
.u-card-elevated-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
}
.u-card-accent-box {
  background: var(--glass-card);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  padding: 14px;
}
.u-card-row-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.u-input-mini-num {
  width: 50px;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: #ffffff;
  padding: 4px;
}
.u-capture-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--status-info);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.u-modal-card-sm {
  max-width: 380px;
  width: 90%;
  text-align: center;
  padding: 24px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
}
.u-modal-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  font-size: 24px;
}
.u-modal-icon-circle.gold {
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
}
.u-modal-icon-circle.danger {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.32);
}

#modalTgCapture { z-index: 9999; }
#bcStatusFeedback { padding: 10px; border-radius: 10px; }
.u-text-right { text-align: right; }
/* Unified Bottom Sheet pattern for covered modals (excluding Privetka modals) */
.modal-backdrop:not(#modalPrivetkaSettings):not(#modalCreateSeq) {
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal-backdrop:not(#modalPrivetkaSettings):not(#modalCreateSeq) .modal-card {
  width: 100%;
  max-width: 520px;
  max-height: min(88dvh, 88vh);
  overflow-y: auto;
  border-radius: 26px 26px 0 0;
  border-bottom: none;
  padding: 12px 20px max(20px, env(safe-area-inset-bottom));
  animation: sheetSlideUp 0.28s var(--ios-fluid);
}
@keyframes sheetSlideUp {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: translateY(0); }
}

.u-modal-close-x {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.u-btn-traffer-del {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  color: var(--status-danger);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.u-btn-full-secondary {
  width: 100%;
  padding: 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  border-radius: 9px;
  margin-bottom: 16px;
}
.u-btn-danger-soft {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.u-btn-icon-sq {
  height: 42px;
  width: 42px;
  padding: 0;
  border-radius: 12px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-medium);
  cursor: pointer;
}
.u-btn-pill-42 {
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.u-seg-tab-compact {
  flex: 1;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.u-seg-tab-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.u-chk-lg { transform: scale(1.3); cursor: pointer; }
.u-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.u-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.u-btn-action-pad { text-align: center; padding: 10px; font-weight: 600; }
.u-modal-head-title { font-size: 16px; font-weight: 800; color: #ffffff; margin: 0; }
.u-modal-card-md { max-width: 440px; width: 92%; max-height: 88vh; overflow-y: auto; }
.u-card-section-box {
  background: rgba(22, 22, 25, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.u-approve-process {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 16px;
}
.u-approve-result { font-size: 13px; line-height: 1.5; color: #ffffff; }
.u-btn-flex-pad12 { flex: 1; padding: 12px; }

/* === Profile, Modals & Create Link Cleanup === */
.u-prof-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, #f3dcab 0%, #d9b46c 100%);
  border: 1px solid rgba(255, 240, 200, 0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 800; color: #09090b; flex-shrink: 0;
  overflow: hidden;
}
.u-prof-avatar img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.u-prof-name {
  font-size: 15px; font-weight: 800; color: #ffffff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.u-prof-id-badge {
  font-size: 11px; font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px; border-radius: 4px; color: var(--text-muted);
}
.u-prof-note {
  font-size: 12px; color: var(--text-dim); line-height: 1.4;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-subtle);
  padding: 8px 10px; border-radius: var(--radius-sm);
}
.u-gold-info-box {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
}
.u-gold-cta-sm {
  padding: 7px 12px; font-size: 12px;
  background: var(--accent-primary); color: var(--on-accent);
  font-weight: 800; border-radius: 9px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.u-seg-bar-sm {
  margin-bottom: 12px;
  background: rgba(22, 22, 25, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 3px; border-radius: 10px;
  display: flex; gap: 6px;
}
.u-spinner-gold {
  width: 28px; height: 28px;
  border: 2.5px solid var(--accent-primary); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 0 auto 14px auto;
}
.u-spinner-sm {
  width: 18px; height: 18px;
  border: 2px solid var(--accent-primary); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.u-sub-modal-card { max-width: 380px; text-align: center; padding: 26px 22px; }
.u-sub-hero-ico { font-size: 46px; margin-bottom: 12px; filter: drop-shadow(0 4px 16px rgba(255, 255, 255, 0.45)); }
.u-modal-btn-pri { height: 44px; font-size: 14px; font-weight: 700; border-radius: 12px; }
.u-modal-btn-sec {
  height: 38px; font-size: 13px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.06); color: var(--text-muted);
  border: 1px solid var(--border-subtle); cursor: pointer;
}
.u-btn-ghost-42 {
  height: 42px; padding: 0 16px; border-radius: 10px; white-space: nowrap;
  font-size: 13px; background: rgba(255, 255, 255, 0.08);
  color: #ffffff; border: 1px solid var(--border-medium); cursor: pointer;
}
.u-warn-box {
  padding: 10px 12px;
  background: rgba(255, 180, 0, 0.08);
  border: 1px solid rgba(255, 180, 0, 0.25);
  border-radius: 10px; font-size: 11px; color: #fde68a; line-height: 1.4;
}
.u-conflict-cancel {
  flex: 1; padding: 10px; background: transparent;
  border: 1px solid var(--border-subtle); color: var(--text-muted);
  border-radius: 10px; font-weight: 700; cursor: pointer;
}
.u-conflict-confirm {
  flex: 1; padding: 10px; background: var(--accent-gradient); border: none;
  color: var(--on-accent); border-radius: 10px; font-weight: 700; cursor: pointer;
}
.u-create-link-sheet { height: auto; max-height: 80vh; padding-bottom: 24px; }
.u-create-link-check {
  margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-subtle);
  padding: 12px; border-radius: var(--radius-sm);
}
.u-btn-full-13 { width: 100%; padding: 13px; font-size: 14px; font-weight: 700; }
.u-btn-full-11 { width: 100%; text-align: center; padding: 11px; font-weight: 700; }
.u-btn-full-10 { width: 100%; text-align: center; padding: 10px; font-weight: 600; }

/* === Obsidian & Gold Telemetry Signature Layer === */
body {
  position: relative;
}
body::before {
  content: "";
  position: fixed;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 320px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 50% 20%, rgba(217, 180, 108, 0.12) 0%, rgba(217, 180, 108, 0.03) 45%, transparent 72%);
  transition: background 0.35s ease;
}
body[data-nav="tasks"]::before {
  background: radial-gradient(ellipse at 50% 20%, rgba(76, 199, 154, 0.11) 0%, rgba(217, 180, 108, 0.03) 48%, transparent 72%);
}
body[data-nav="bots"]::before {
  background: radial-gradient(ellipse at 50% 20%, rgba(232, 176, 79, 0.13) 0%, rgba(217, 180, 108, 0.035) 48%, transparent 72%);
}
body[data-nav="requests"]::before {
  background: radial-gradient(ellipse at 50% 20%, rgba(239, 208, 146, 0.10) 0%, rgba(76, 199, 154, 0.03) 48%, transparent 72%);
}
body[data-nav="profile"]::before {
  background: radial-gradient(ellipse at 50% 20%, rgba(255, 255, 255, 0.09) 0%, rgba(217, 180, 108, 0.05) 48%, transparent 72%);
}

/* Specular card depth */
.clean-section-card, .glass-card, .cbot-card, .audit-card, .task-card, .link-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.036) 0%, rgba(19, 19, 22, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-top-color: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 10px 28px -18px rgba(0, 0, 0, 0.75);
}

/* Scenario cards with gold active highlight */
.scenario-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.032), rgba(19, 19, 22, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.scenario-card.active {
  background: linear-gradient(180deg, rgba(217, 180, 108, 0.15), rgba(28, 28, 33, 0.96));
  border-color: rgba(217, 180, 108, 0.45);
  box-shadow: inset 0 1px 0 rgba(239, 208, 146, 0.25), 0 8px 22px -12px rgba(217, 180, 108, 0.35);
}
.scenario-card.active .scenario-icon {
  background: linear-gradient(135deg, #efd092, #d9b46c);
  border-color: rgba(255, 255, 255, 0.35);
  color: #09090b;
}

/* Segment & Dock active polish */
.segment-btn.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(39, 39, 42, 0.95));
  border-color: rgba(217, 180, 108, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.dock-tab-btn.active {
  color: #fafafa;
  background: linear-gradient(180deg, rgba(217, 180, 108, 0.16), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(217, 180, 108, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.dock-tab-btn.active .dock-icon {
  color: #efd092;
}

/* Telegram dark chat wallpaper canvas for previews */
#cardSimPreview, .tg-sim-canvas, .telegram-bubble-card {
  background-color: #0e0f12;
  background-image:
    radial-gradient(rgba(217, 180, 108, 0.07) 1px, transparent 1px),
    radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Community avatars with smooth image fade-in over initials fallback */
.channel-avatar, .audience-ch-avatar {
  position: relative;
  overflow: hidden;
}
.channel-avatar img, .audience-ch-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.channel-avatar img.loaded, .audience-ch-avatar img.loaded {
  opacity: 1;
}

/* De-noise: hide redundant subtitles and obvious helper boxes */
.section-subtitle,
.bots-hub-sub,
.scenario-desc,
.u-prof-note,
#viewCreate .clean-card-desc,
#viewProfile .clean-card-desc {
  display: none;
}
.section-title-wrap { margin: 2px 0 12px; }
.clean-card-header { margin-bottom: 12px; }

/* Pro animated header logo keyframes */
@keyframes postikPlaneFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(1.2px, -1.4px) rotate(-3deg); }
}
@keyframes postikTrailPulse {
  0%, 100% { opacity: 0.28; transform: translate(0, 0); }
  50% { opacity: 0.95; transform: translate(1px, -0.7px); }
}
@keyframes postikSparkPulse {
  0%, 100% { opacity: 0.35; transform: scale(0.75); }
  50% { opacity: 1; transform: scale(1.2); }
}
@keyframes postikLogoSweep {
  0%, 62% { transform: translateX(-115%); }
  85%, 100% { transform: translateX(115%); }
}
@keyframes postikTextShimmer {
  0%, 55% { background-position: 100% 0; }
  85%, 100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark::after,
  .brand-mark .logo-plane,
  .brand-mark .logo-trail-1,
  .brand-mark .logo-trail-2,
  .brand-mark .logo-spark,
  .brand-group h1 { animation: none !important; }
}

/* Audience TGStat, Keep Retention & Bulk Donor Checker */
.tgstat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.tgstat-kpi {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.tgstat-kpi-val {
  font-size: 16px;
  font-weight: 800;
  color: #efd092;
  letter-spacing: -0.02em;
}
.tgstat-kpi-lbl {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.tgstat-sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--text-muted);
}
.keep-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(19, 19, 22, 0.85);
  border: 1px solid rgba(239, 208, 146, 0.16);
}
.keep-summary-cell {
  text-align: center;
}
.keep-summary-cell b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}
.keep-summary-cell span {
  font-size: 10px;
  color: var(--text-dim);
}
.keep-retention-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  margin-top: 8px;
}
.keep-retention-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d9b46c, #4ade80);
  transition: width 0.3s ease;
}
.joiner-status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}
.joiner-status-pill.in {
  background: rgba(74, 222, 128, 0.14);
  color: #4ade80;
}
.joiner-status-pill.out {
  background: rgba(248, 113, 113, 0.14);
  color: #f87171;
}
.joiner-status-pill.pending {
  background: rgba(239, 208, 146, 0.14);
  color: #efd092;
}
.link-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.link-filter-pill {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  cursor: pointer;
}
.link-filter-pill.active {
  border-color: rgba(239, 208, 146, 0.45);
  background: rgba(239, 208, 146, 0.12);
  color: #efd092;
}
.joiner-status-pill.fast {
  background: rgba(248, 113, 113, 0.22);
  color: #fca5a5;
}
.telescope-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.telescope-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.telescope-cell {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
}
.telescope-cell b {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}
.telescope-cell span {
  font-size: 10px;
  color: var(--text-dim);
}
.telescope-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
}
