/* /assets/pm3k.css */
:root { --bg:#0b0b10; --card:#14141c; --txt:#e9e9ef; --muted:#a9a9b6; --accent:#7aa2ff; }
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--txt);
  font:16px/1.55 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

.wrap{ max-width:1024px; margin:0 auto; padding:28px 20px 64px; }

/* Header */
header{ display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand{ display:flex; align-items:center; gap:12px; text-decoration:none; color:var(--txt); }
.logo{ width:28px; height:28px; display:inline-block; }
nav a{ color:var(--muted); text-decoration:none; margin-left:18px; }
nav a:hover{ color:var(--txt); }

/* Buttons */
.btn{ padding:10px 14px; border-radius:10px; border:1px solid rgba(255,255,255,.12); text-decoration:none; color:var(--txt); background:transparent; cursor:pointer; }
.btn.primary{ background:var(--accent); color:#0a0a0a; border-color:transparent; }
.btn:disabled,
.btn[aria-disabled="true"]{ opacity:.6; cursor:not-allowed; pointer-events:none; }

/* Button loader (визуальный кайф) */
@keyframes pm3k-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }
.btn.loading{ position:relative; color:transparent !important; opacity:.9; }
.btn.loading::after{
  content:''; position:absolute; left:50%; top:50%;
  width:16px; height:16px; margin:-8px 0 0 -8px; border-radius:50%;
  border:2px solid rgba(255,255,255,.55); border-top-color:transparent;
  animation: pm3k-spin .9s linear infinite;
}

/* Cards & generic grid */
.card{ background:var(--card); border:1px solid rgba(255,255,255,.08); border-radius:14px; padding:16px; margin-top:16px; }
.grid{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
@media(max-width:900px){ .grid{ grid-template-columns:1fr; } }

/* Index (hero + pricing) */
.hero{
  margin:56px 0 28px;
  padding:28px 28px 24px;
  background:var(--card);
  border-radius:16px;
  border:1px solid rgba(255,255,255,.06);

  display:grid;
  grid-template-columns:minmax(260px,360px) minmax(0,1fr);
  column-gap:56px;
  align-items:flex-start;
}

/* левая и правая колонки */
.hero-left{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.hero-right{
  display:flex;
  flex-direction:column;
  gap:16px;
}

/* “картинка” под капсулой */
.hero-media{
  margin-top:14px;
  width:100%;
  aspect-ratio:16/9;      /* чтобы высота сама считалась, как у баннера */
  border-radius:18px;
  overflow:hidden;
}

.hero-media img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;       /* чтобы картинка красиво обрезалась по краям */
}

/* HERO banner */
.hero-banner{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 18px;
  border-radius:999px;
  background:linear-gradient(135deg,#7aa2ff,#8ef5ff);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04),
    0 18px 40px rgba(4,12,34,0.65);
  color:#050509;
  font-size:20px;
  font-weight:600;
  line-height:1.3;
  letter-spacing:0.01em;
}

.hero-banner-mark{
  padding:4px 10px;
  border-radius:999px;
  background:rgba(5,5,10,0.9);
  color:#e9f1ff;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:0.08em;
}

.hero-banner-title{
  white-space: nowrap;
  font-size:17px;   /* или 17–18px, подбери на глаз */
}

/* адаптив: при узком экране складываем в одну колонку */
@media (max-width:960px){
  .hero{
    grid-template-columns:minmax(0,1fr);
    row-gap:20px;
  }
}

@media (max-width:640px){
  .hero-banner{
    flex-wrap:wrap;
    font-size:18px;
  }
  .hero-banner-title{
    white-space:normal;
  }
}

h1{
  margin:0 0 10px;
  font-size:28px;
  line-height:1.2;
}

p.lead{
  margin:0;
  color:var(--muted);
}
.hero-right .lead{
  font-size:18px;
  line-height:1.7;
}


/* CTA (Connect + API Docs) */
.cta{
  display:flex;
  gap:22px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:4px;          /* чуть ниже текста */
  justify-content:flex-start; /* кнопки строго слева */
}

.cta .btn{
  display:inline-flex;
  align-items:center;
  height:40px;
  padding:0 16px;
}
/* дополнительный отступ между кнопками в hero */
.hero .cta .btn + .btn{
  margin-left:12px;   /* если хочется ещё — поставь 16 или 20 */
}


/* CTA (Connect + API Docs) */
.cta{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:4px;
}
.cta .btn{
  display:inline-flex;
  align-items:center;
  height:40px;
  padding:0 16px;
}

/* адаптация */
@media (max-width:900px){
  .hero-layout{
    grid-template-columns:1fr;
  }
}

@media (max-width:640px){
  .hero-banner{
    flex-wrap:wrap;
    font-size:18px;
  }
  .hero-banner-title{
    white-space:normal;
  }
}


h1{ margin:0 0 10px; font-size:28px; line-height:1.2; }
p.lead{ margin:0 0 18px; color:var(--muted); }

/* CTA (Connect + API Docs) */
.cta{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; margin-top:12px; }
.cta .btn{ display:inline-flex; align-items:center; height:40px; padding:0 16px; }

/* Features */
.features-grid{ display:grid; grid-template-columns:repeat(3,minmax(280px,1fr)); gap:16px; align-items:stretch; }
.features-grid .card{ margin-top:0; height:100%; }
@media (max-width:1024px){ .features-grid{ grid-template-columns:1fr; } }

/* Pricing */
.section-title{ font-size:22px; margin:32px 0 12px; }
.plans{ display:grid; grid-template-columns:repeat(3,minmax(260px,1fr)); gap:14px; align-items:stretch; }
@media (max-width:1200px){ .plans{ grid-template-columns:repeat(2,minmax(260px,1fr)); } }
@media (max-width:900px){  .plans{ grid-template-columns:1fr; } }

.plan{ background:var(--card); border:1px solid rgba(255,255,255,.06); border-radius:12px; padding:18px; display:flex; flex-direction:column; }
.plan h3{ margin:0; }
.price{ font-weight:700; font-size:22px; margin:8px 0; }
.plan ul{ margin:8px 0 12px; padding-left:18px; color:var(--muted); }
.plan .btn{ display:inline-block; margin-top:6px; }
.pill{ display:inline-block; background:rgba(122,162,255,.18); padding:2px 8px; border-radius:999px; font-size:12px; margin-left:8px; color:var(--txt); }
.plan.selected{ border-color:var(--accent); box-shadow:0 0 0 2px rgba(122,162,255,.25); }

/* Hide native radio dot in pricing cards */
.plans .radio input{
  position:absolute; opacity:0; width:1px; height:1px; margin:-1px; padding:0; border:0;
  clip:rect(0 0 0 0); clip-path:inset(100%); overflow:hidden;
}
.plans .radio{ cursor:pointer; }

/* Tooltip */
.hint{ position:relative; display:inline-block; }
.hint .i{ display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; font-size:12px; border:1px solid rgba(255,255,255,.3); border-radius:50%; margin-left:6px; color:var(--muted); cursor:default; }
.hint .bubble{ display:none; position:absolute; z-index:10; left:0; top:22px; min-width:220px; background:var(--card); color:var(--txt); border:1px solid rgba(255,255,255,.12); border-radius:10px; padding:10px 12px; box-shadow:0 8px 24px rgba(0,0,0,.35); }
.hint:hover .bubble, .hint:focus-within .bubble{ display:block; }
.hint.compact .bubble{ font-size:12.5px; line-height:1.45; padding:8px 10px; max-width:320px; }
.hint.compact .i{ width:14px; height:14px; font-size:11px; }

footer{ margin-top:40px; color:var(--muted); font-size:14px; }

/* Flatpickr (dark) */
.flatpickr-calendar{ background:var(--card); color:var(--txt); border:1px solid rgba(255,255,255,.12); }
.flatpickr-months .flatpickr-month, .flatpickr-weekday{ color:var(--muted); }
.flatpickr-day{ color:var(--txt); }
.flatpickr-day.today{ border-color:var(--accent); }
.flatpickr-day:hover,
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange{ background:var(--accent); color:#0a0a0a; }

/* Dashboard layout */
.page-dashboard .hint .bubble{ font-size:12px; line-height:1.4; padding:6px 9px; max-width:300px; }
.page-dashboard .hint .i{ width:13px; height:13px; font-size:10px; }
.dashboard-grid{ display:grid; grid-template-columns:repeat(2,minmax(360px,1fr)); gap:16px; }
@media (max-width:1000px){ .dashboard-grid{ grid-template-columns:1fr; } }
nav a[hidden]{ display:none !important; }

/* Toasts */
.pm3k-toast-wrap{
  position:fixed; right:16px; bottom:16px; z-index:9999;
  display:flex; flex-direction:column; gap:8px;
}
.pm3k-toast{
  padding:10px 14px; border-radius:10px; background:#12121a;
  border:1px solid rgba(255,255,255,.12); color:var(--txt);
  box-shadow:0 6px 20px rgba(0,0,0,.35); font-size:14px; opacity:0;
  transform:translateY(8px); transition:opacity .18s ease, transform .18s ease;
}
.pm3k-toast.show{ opacity:1; transform:translateY(0); }
.pm3k-toast.success{ border-color:rgba(64,192,120,.6); }
.pm3k-toast.error{ border-color:rgba(240,96,96,.6); }
.pm3k-toast.info{ border-color:rgba(120,160,255,.6); }
/* Job modal */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.visible {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-dialog {
  position: relative;
  background: #0f0f16;
  padding: 16px 20px;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
}

.modal-dialog h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 16px;
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  color: var(--txt);
  font-size: 18px;
  cursor: pointer;
}

.job-details {
  font-size: 13px;
  line-height: 1.5;
}

.job-details-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.job-details-label {
  opacity: 0.7;
}

.job-details-value {
  text-align: right;
  word-break: break-all;
}

/* на всякий случай, если нет */
.job-row {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
  cursor: pointer;
}

.job-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
/* Jobs list (dashboard) */
.jobs-list{
  margin-top: 6px;
  font-size: 13px;
}

.jobs-empty{
  font-size: 13px;
  color: var(--muted);
}

/* строка в списке */
.job-row {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
  cursor: pointer;
  background: transparent;
  width: 100%;
  text-align: left;
}

.job-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

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

.job-row-title{
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-row-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

/* плашка статуса */
.job-status-pill{
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
}

/* базовые цвета под несколько состояний */
.job-status-scheduled,
.job-status-pending,
.job-status_in_progress{
  background: rgba(122,162,255,.18);
}

.job-status-done,
.job-status_publish_complete{
  background: rgba(64,192,120,.25);
}

.job-status-failed,
.job-status_publish_failed{
  background: rgba(240,96,96,.25);
}

/* helper под наш HTML: modal + .hidden */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.visible{
  display: flex;
}

.modal.hidden{
  display: none;
}

.modal-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.modal-dialog{
  position: relative;
  background: #0f0f16;
  padding: 16px 20px;
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 16px 40px rgba(0,0,0,.8);
}

.modal-dialog h3{
  margin: 0 0 10px;
  font-size: 16px;
}

.modal-close{
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  color: var(--txt);
  font-size: 18px;
  cursor: pointer;
}

.job-details{
  font-size: 13px;
  line-height: 1.5;
}

.job-details-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.job-details-label{
  opacity: .7;
}

.job-details-value{
  text-align: right;
  word-break: break-all;
}
.job-row-sub-left,
.job-row-sub-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.job-row-sub-right {
  margin-left: auto; /* уезжает вправо */
}
.job-row-delete {
  padding-inline: 10px;
}


