*{
  box-sizing:border-box;
}


body::after{
  content:"";
  position:fixed;
  inset:0;

  opacity:0.035;

  background-image:
    repeating-radial-gradient(
      circle at 0 0,
      rgba(0,0,0,0.35) 0,
      transparent 2px
    );

  background-size:12px 12px;

  pointer-events:none;
}

body{
  margin:0;
  padding:0;
  background:#edf2f7;
  font-family:system-ui, -apple-system, sans-serif;
  color:#1f2a37;
}


body::before {
  content: "";
  position: fixed;
  inset: 0;

 
  background-size: cover;
  background-position: center;

  opacity: 0.15;
  pointer-events: none;
}



#leftPanel {
  width: 25%;
  position: sticky;
  top: 0;

  height: 100vh;
  overflow: auto;
padding: 8px;
  box-sizing: border-box;
border-radius: 14px;
  background: #f8fafc;
  display:flex;
  flex-direction:column;
}

/* RIGHT — чуть темнее */
#rightPanel {
  width: 25%;
  position: sticky;
  top: 0;
padding: 8px;
  height: 100vh;
  overflow: auto;

  box-sizing: border-box;
border-radius: 14px;
  background: #f1f5f9;
}

/* PREVIEW — ещё чуть глубже, но всё ещё светлый */
#previewPanel {
  width: 50%;
  position: sticky;
  top: 0;
padding: 8px;
  height: 100vh;
  overflow: auto;

  box-sizing: border-box;

  background: #e6edf5;
  border-radius: 14px;
}



#leftBottom{
  position:sticky;
  bottom:10px;
  display:flex;
  justify-content:center;
}

#langSelect {
  width: 240px;
  padding: 12px 14px;

  background: #ff7175; /* 👈 как FAB */
  color: #ffffff;

  border: none;
  border-radius: 10px;

  font-weight: 600;

  appearance: none;
  cursor: pointer;

  transition: 0.2s;

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

#langSelect:hover {
  transform: scale(1.03);
  background: #ff5f66;
}

#langSelect:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 113, 117, 0.35);
}
h2, h3{
  margin-top:25px;
  margin-bottom:10px;
}

label{
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;

  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

/* поля */
input{
  width:100%;
  padding:10px 12px;
  margin-top:6px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
  outline:none;
  transition:.2s;
  max-width:100%;
}

.imageSpoiler summary {
  cursor: pointer;
  font-weight: 600;
  margin: 5px 0;
}

.top-form{
  max-width: 520px;
  margin: 0 auto;          /* 🔥 центрирование */
  text-align: center;      /* текст по центру */

  padding: 20px;
  margin-top: 12px;

  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;

  box-shadow: 0 6px 20px rgba(0,0,0,.05);
}

.top-form input{
  width: 100%;
  max-width: 420px;

  display: block;
  margin: 6px auto 12px auto;

  padding: 10px 12px;

  border-radius: 10px;
  border: 1px solid #e5e7eb;

  background: #f9fafb;

  outline: none;
}

.top-form label{
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;

  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
}

#createFields{
  display: inline-block;

  background: #6d8bad;
  color: white;

  border: none;
  border-radius: 10px;

  padding: 10px 16px;

  font-weight: 600;

  cursor: pointer;

  margin-top: 10px;

  box-shadow: 0 4px 12px rgba(109,139,173,.25);
  transition: .2s ease;
}

#createFields:hover{
  background: #5c7b9c;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(109,139,173,.35);
}

#createFields:active{
  transform: scale(0.98);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

#appLayout{
  display:flex;

  gap:12px;

  width:100%;
  max-width:none;

  padding:8px;

  align-items:flex-start;
  box-sizing:border-box;
}

/* MAIN LAYOUT */
#appLayout {
  display: flex;
  gap: 12px;              /* 👈 ВОТ ТУТ расстояние между колонками */
  padding: 0;             /* нет внешних отступов у всей сетки */
  margin: 0;
  width: 100%;
  height: 100vh;
  box-sizing: border-box;
}



#generateStatus{
  margin-top:12px;
  font-size:13px;
  color:#64748b;
  min-height:18px;
}

.loading{
  color:#2563eb;
  font-weight:600;
}

.success{
  color:#16a34a;
  font-weight:600;
}



input:not(.smartTitle):not(.extraSmartTitle):not(.extraDescription){
  width: 100%;
  max-width: 420px;   /* чтобы не было “во всю ширину” */

  padding: 10px 12px;

  border-radius: 10px;
  border: 1px solid #e5e7eb;

  background: #f9fafb;

  outline: none;

  transition: .2s ease;
  margin-bottom: 8px;
}

input:focus{
  border-color: #ff7175;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,113,117,.15);
}

input:focus{
  border-color:#6d8bad;
  box-shadow:0 0 0 3px rgba(109,139,173,.15);
}

/* textarea */
textarea{
  width:100%;
  height:240px;
  margin-top:15px;
  padding:12px;
  border:1px solid #d1d5db;
  border-radius:10px;
  background:#fff;
  font-family:monospace;
  max-width:100%;
}

/* кнопки */
button{
  
  padding:10px 16px;
  background:#6d8bad;
  color:white;
  border:0;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  transition: all .2s ease;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
  position: relative;
  overflow: hidden;
}

button:hover{
  transform: translateY(-2px) scale(1.02);
  background:#5c7b9c;
  box-shadow:0 6px 14px rgba(109,139,173,.35);
}

button:active{
  transform: translateY(0px) scale(0.98);
  box-shadow:0 2px 6px rgba(0,0,0,.15);
}

button::after{
  content:"";
  position:absolute;
  top:0;
  left:-75%;
  width:50%;
  height:100%;
  background:linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform:skewX(-20deg);
}

button:hover::after{
  left:130%;
  transition: .6s ease;
}


#copyHTML{
  margin-top:12px;
  padding:10px 16px;
  background:#e11d48;   /* красный */
  color:white;
  border:0;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  transition: all .2s ease;
  box-shadow:0 2px 6px rgba(0,0,0,.08);
  position: relative;
  overflow: hidden;
}

#copyHTML:hover{
  background:#be123c;
}

#copyHTML:active{
  transform:scale(0.98);
}



#generateHTML {
  background: #ff7175; /* FAB цвет */
  color: #fff;

  border-radius: 10px;
  border: none;

  font-weight: 700;

  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);

  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}

#generateHTML:hover {
  transform: translateY(-2px) scale(1.03);
  background: #ff5f66;
  box-shadow: 0 12px 28px rgba(255, 113, 117, 0.35);
}

#generateHTML:active {
  transform: translateY(0px) scale(0.98);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
}

#generateHTML::after {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-20deg);
}

#generateHTML:hover::after {
  left: 130%;
  transition: 0.6s ease;
}


#appHeader {
  position: sticky;
  top: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 14px 20px;

  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(14px);

  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 14px;

  margin: 12px auto;
  max-width: 900px;

  box-shadow: 0 10px 30px rgba(0,0,0,0.08);

  z-index: 999;

  position: sticky;
}

#appHeader {
  position: sticky;
  top: 0;

  position: sticky;
  overflow: visible;
}


#appTitle {
  margin: 0;
  font-size: 20px;
  font-weight: 600;

  text-align: center;

  flex: 1;
}

#appLogo {
  position: absolute;
  right: 16px;

  width: 85px;   /* ≈ 2.5x больше */
  height: 85px;

  object-fit: contain;

  pointer-events: none;
}

.title-presets{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:8px;
}

.title-chip {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  transition: 0.15s;
  border: 1px solid rgba(0,0,0,0.05);
}

.title-chip:hover {
  transform: scale(1.05);
  filter: brightness(0.95);
}

@keyframes titleIn {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.image-input-wrapper {
    position: relative;
    width: 100%;
}


.image-input-wrapper input {
    width: 100%;
    height: 38px;
    box-sizing: border-box;
    padding-right: 45px;
}

.input-upload {
    position: relative;
    width: 100%;
}


.image-input-wrapper {
    position: relative;
    width: 100%;
}


.image-input-wrapper input.image {

    width: 100%;
    height: 38px;

    box-sizing: border-box;

    padding-right: 45px;

}



button.uploadNewsImage,
button.uploadExtraImage,
#uploadMainImage {

    position: absolute !important;

    right:5px;
    top:50%;

    transform:translateY(-50%);

    width:32px;
    height:32px;

    padding:0 !important;
    margin:0 !important;

    border:none;
    border-radius:6px;

    background:white;

    cursor:pointer;

    display:flex;
    align-items:center;
    justify-content:center;

    box-shadow:none;

}


#uploadMainImage img,
.uploadNewsImage img,
.uploadExtraImage img {

    width:22px;
    height:22px;

    object-fit:contain;

}


#uploadMainImage:hover img,
.uploadNewsImage:hover img,
.uploadExtraImage:hover img {

    transform:scale(1.1);

}


#uploadMainImage:hover,
.uploadNewsImage:hover,
.uploadExtraImage:hover {

    background:#eee;

}


#mainImageFile,
.newsImageFile,
.extraImageFile {

    display:none;

}


.ad-card.active {
  border: 2px solid #4a90e2;
  background: #eaf3ff;
  box-shadow: 0 8px 18px rgba(74,144,226,0.15);
  transform: translateY(-1px);
}

.ad-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  background: #f5f9ff;
  border-color: rgba(74,144,226,0.4);
}

.ad-card:active {
  transform: scale(0.98);
}

.ad-hint {
  font-size: 14px;
  color: #6b7280;
  margin-top: 10px;
  padding: 6px 8px;

  background: rgba(0,0,0,0.03);
  border-radius: 6px;
}



#adSelector2.visible {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none;
}
/* =========================
   ОСНОВНЫЕ КАРТОЧКИ (УЛУЧШЕННЫЙ UI)
   ========================= */

.news-block{
  background: white;
  border: 1px solid #ececec;

  border-radius: 14px;

  box-shadow: 0 4px 14px rgba(0,0,0,.04);

  padding: 16px;

  margin-bottom: 12px;

  transition: .2s ease;
}

.news-block:hover{
  transform: translateY(-2px);
}

/* клик ощущение */
.news-block:active{
  transform: scale(0.99);
}

/* =========================
   LABEL (редакторский стиль)
   ========================= */

.news-block label{
  display: block;
  margin-top: 12px;
  margin-bottom: 6px;

  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

/* =========================
   INPUTS (картинка и т.д.)
   ========================= */

.news-block input{
  width: 100%;
  padding: 10px 12px;

  border-radius: 10px;
  border: 1px solid #e5e7eb;

  background: #f9fafb;

  outline: none;

  transition: .2s ease;
}

.news-block input:focus{
  border-color: #ff7175;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,113,117,.15);
}

/* =========================
   EDITABLE ПОЛЯ (самое важное)
   ========================= */

.smartTitle.editor,
.extraSmartTitle.editor,
.extraDescription.editor{
  width: 100%;
  min-height: 44px;

  padding: 12px 14px;

  border-radius: 12px;
  border: 1px solid #e5e7eb;

  background: #f9fafb;

  outline: none;

  font-size: 14px;
  line-height: 1.4;

  transition: .2s ease;
}

/* фокус как у Apple / Notion */
.smartTitle.editor:focus,
.extraSmartTitle.editor:focus,
.extraDescription.editor:focus{
  border-color: #ff7175;
  background: #ffffff;

  box-shadow: 0 0 0 3px rgba(255,113,117,.15);
}

/* hover эффект */
.smartTitle.editor:hover,
.extraDescription.editor:hover{
  border-color: #d1d5db;
}

.pop{
  animation: popIn .25s ease;
}

.sectionType {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;

  border: 1px solid rgba(0,0,0,0.08);
  background: #f8fafc;

  font-size: 13px;
  color: #1f2937;

  outline: none;

  cursor: pointer;
  transition: all 0.2s ease;
}

.sectionType:hover {
  border-color: rgba(109,139,173,0.5);
  background: #f3f6fb;
}

.sectionType:focus {
  border-color: #6d8bad;
  box-shadow: 0 0 0 3px rgba(109,139,173,0.15);
}

/* =========================
   MODAL OVERLAY (TILDA STYLE)
========================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

/* wide centered box */
.modal-box {
  width: 90%;
  max-width: 1000px;
  background: #ffffff;
  border-radius: 16px;
  padding: 60px 40px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 80px rgba(0,0,0,0.6);
}

/* big orange link */
.modal-link {
  font-size: 28px;
  font-weight: 600;
  color: #000000;
  word-break: break-all;
  text-decoration: none;
  display: inline-block;
  margin-top: 10px;
}

.modal-link:hover {
  color: #ff5f66;
  
}

/* close button */
.modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 30px;
  color: #000000;
  cursor: pointer;
  opacity: 0.7;
}

.modal-title-text {
  font-size: 25px;
  color: rgba(0, 0, 0, 0.65);
  margin-bottom: 1px;
  letter-spacing: 0.2px;
}

.modal-close:hover {
  opacity: 1;
}

.modal-status-text {
  font-size: 28px;
  font-weight: 700;
  color: #ff5f66;
  margin-top: 20px;
}
/* =========================
   ВАЖНО: КОНТРАСТ "ПОДМЕНЮ"
   ========================= */

/* ВСЕ динамические блоки внутри секций */
#newsFields > .news-block,
#extraSectionNewsFields > .news-block,
#extraSectionNewsFields3 > .news-block,
#extraSectionDarkFields > .news-block,
#extraSectionDarkFields5 > .news-block,
#extraSectionNewsFields5 > .news-block{

  background:#f8fafc;              /* чуть холоднее фон */
  border:1px solid #cbd5e1;        /* более заметная рамка */
  border-left:5px solid #6d8bad;   /* акцент слева */
  box-shadow:0 1px 6px rgba(0,0,0,.06);
  border-left:5px solid #6d8bad;
padding-left:10px;           /* ощущение вложенности */
flex:1;
  overflow:auto;
}

/* усиливаем заголовки внутри вложенных */
#newsFields .news-block h4,
#extraSectionNewsFields .news-block h4,
#extraSectionNewsFields3 .news-block h4,
#extraSectionDarkFields .news-block h4,
#extraSectionDarkFields5 .news-block h4,
#extraSectionNewsFields5 .news-block h4{
  color:#0f172a;
  font-size:13px;
}

/* превью */
#preview{
  margin-top:25px;
  background:white;
  padding:12px;
  border:1px solid #6d8bad;
  border-radius:12px;
  min-height:300px;
  box-shadow:0 6px 18px rgba(0,0,0,.06);
}

.colHeader{
  background:#ff7175;
  color:white;

  font-weight:700;
  font-size:14px;
  letter-spacing:1px;

  text-transform:uppercase;

  padding:10px 12px;

  border-radius:10px;

  margin-bottom:0; /* важно — без отступа вниз */

  position:sticky;
  top:0;

  z-index:10;
}


/* ===== базовый редактор ===== */
.editor{
  border:1px solid #d0d7de;
  padding:12px;
  min-height:90px;
  background:#ffffff;
  margin-top:6px;
  border-radius:12px;

  width:100%;
  box-sizing:border-box;

  outline:none;
  font-family:Arial, sans-serif;
  font-size:14px;
  line-height:1.55;

  transition: all 0.2s ease;
}

/* ===== placeholder ===== */
.editor:empty:before,
.editor:not(:focus):empty:before{
  content: attr(data-placeholder);
  color:#8b949e;
  pointer-events:none;
}

/* ===== TITLE — заметный, “карточный” ===== */
.editor--title{
  background: linear-gradient(180deg, #f0f6ff 0%, #ffffff 100%);
  border: 2px solid #9bbcf5;
  box-shadow: inset 0 0 0 1px rgba(155,188,245,0.25);
}

/* ===== DESCRIPTION — спокойнее, серее ===== */
.editor--desc{
  background: #f6f8fa;
  border: 1px solid #cfd8e3;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}

/* ===== focus ===== */
.editor:focus{
  border-color:#3b82f6;
  box-shadow:0 0 0 3px rgba(59,130,246,0.15);
}

/* ===== hover (очень важно для ощущения UI) ===== */
.editor:hover{
  border-color:#93c5fd;
}
/* тулбар */
.toolbar{
  margin-top:8px;
}

.toolbar button{
  background:#374151;
  margin-right:6px;
  padding:6px 10px;
  font-size:12px;
  border-radius:8px;
  box-shadow:none;
  transition: all .15s ease;
}

.toolbar button:hover{
  background:#111827;
  transform: translateY(-1px);
}

.toolbar button:active{
  transform: scale(0.95);
}

input:focus, textarea:focus, .editor:focus{
  border-color:#6d8bad;
  box-shadow:0 0 0 4px rgba(109,139,173,.18);
  transform: translateY(-1px);
}

.news-block h4{
  margin:0 0 10px 0;
  font-size:14px;
  color:#111827;
}

/* FAB */
#addSectionFab {
  margin-top: 16px;

  width: 56px;
  height: 56px;

  border-radius: 50%;
  border: none;

  background: #ff7175;
  color: #fff;

  font-size: 28px;
  font-weight: bold;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow: 0 10px 25px rgba(0,0,0,.2);

  z-index: 10;

  /* 🔥 ключевая часть */
  position: sticky;
  bottom: 12px;

  align-self: flex-start; /* слева */
}

#addSectionFab:hover { 
  
  transform: scale(1.08); 

}

#previewActions{
  display:flex;
  gap:12px;
justify-content: flex-start;
  margin-top:16px;
}

#previewActions button{
  flex:1;
}
.help-tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 8px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  cursor: help;
  font-size: 12px;
  font-weight: 700;
}

.global-tooltip {
  position: fixed;
  z-index: 999999;

  max-width: 280px;

  background: #111827;
  color: #fff;

  padding: 10px 12px;
  border-radius: 10px;

  font-size: 13px;
  line-height: 1.4;

  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: 0.15s ease;

  pointer-events: none;
}

.global-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#loginScreen{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;

  background: rgba(238,242,246,0.6);
  backdrop-filter: blur(10px);

  animation: fadeIn 0.4s ease;
}

.loginCard{
  width:320px;
  background:white;
  padding:30px;
  border-radius:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
  box-sizing:border-box;
  text-align:left;

  animation: popIn 0.35s ease;
}

.loginCard h2{
  margin:0 0 15px 0;
}

.loginCard input{
  width:100%;
  padding:10px;
  margin-top:10px;
  border:1px solid #d1d5db;
  border-radius:10px;
  box-sizing:border-box;
  outline:none;
}

.loginCard button{
  width:100%;
  margin-top:10px;
  padding:10px;
  border:0;
  border-radius:10px;
  background:#6d8bad;
  color:white;
  font-weight:600;
  cursor:pointer;
  box-sizing:border-box;
  transition:.2s;
}

.loginCard button:hover{
  background:#5c7b9c;
}

#loginError{
  color:#e11d48;
  font-size:13px;
  margin-top:10px;
  min-height:16px;
}

#langScreen{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;

  background: rgba(238,242,246,0.6);
  backdrop-filter: blur(10px);

  animation: fadeIn 0.4s ease;
}

.langCard h2 {
  text-align: center;
  margin-bottom: 18px;
}

.langGrid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.langOption {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  cursor: pointer;
  text-align: center;
  font-weight: 500;
  transition: 0.2s;
  user-select: none;
}

.langOption:hover {
  transform: translateY(-2px);
  background: #eef6ff;
  border-color: #93c5fd;
}

.langOption.active {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
  box-shadow: 0 8px 20px rgba(37,99,235,0.25);
}

#langContinueBtn {
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #6d8bad;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
}

#langContinueBtn:hover {
  background: #5c7b9c;
}

.overlayScreen{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;

  background: rgba(238,242,246,0.6);
  backdrop-filter: blur(10px);

  animation: fadeIn 0.4s ease;
}

/* АНИМАЦИИ */
@keyframes fadeIn{
  from {opacity:0;}
  to {opacity:1;}
}

@keyframes popIn{
  from {transform:scale(0.92); opacity:0;}
  to {transform:scale(1); opacity:1;}
}

@keyframes shake{
  0%{transform:translateX(0);}
  20%{transform:translateX(-8px);}
  40%{transform:translateX(8px);}
  60%{transform:translateX(-6px);}
  80%{transform:translateX(6px);}
  100%{transform:translateX(0);}
}

.shake{
  animation: shake 0.35s;
}


@media only screen and (max-width: 600px) {
  .container {
    width: 100% !important;
  }

  .stack {
    display: block !important;
    width: 100% !important;
  }

  .padding-mobile {
    padding: 10px !important;
  }
}
