body { min-height: 100vh; }
.card, .modal-content { border-radius: 1rem !important; }
.article-link, .category-link, .create-item-link, .action-link { white-space: normal; color: inherit; }
.article-link:hover, .category-link:hover, .create-item-link:hover, .action-link:hover { color: var(--bs-primary); }
#articleEditor, #categoryDescription, #manualPromptText, #createEnglishBody, #createBulgarianBody, #openAiSuggestCategoryTemplateInput, #openAiSuggestArticleTemplateInput, #openAiBulkSeoStructureTemplateInput { min-height: 16rem; }
.preview-shell { min-height: 70vh; }
.category-row td, .subcategory-row td { font-weight: 600; }
.table th, .table td { vertical-align: top; }
.table td.text-start .btn { justify-content: flex-start; }
#previewContent {
  width: 100%;
  height: calc(100vh - 62px);
  min-height: calc(100vh - 62px);
  border: 0;
  background: #fff;
  display: block;
}
#previewModal .modal-body { padding: 0 !important; }
#openAiPromptTemplateInput,
#openAiManualPromptTemplateInput,
#openAiItaTemplateInput,
#openAiModelOptionsInput { min-height: 8rem; }
.category-depth-0 td { background: #dbeafe !important; }
.category-depth-1 td { background: #e9f7ef !important; }
.category-depth-2 td { background: #fff3cd !important; }
.category-depth-3 td { background: #f3e8ff !important; }
.category-depth-4 td { background: #ffe5d0 !important; }
.category-actions .btn { --bs-btn-padding-y: .2rem; --bs-btn-padding-x: .45rem; }
.orphan-select { min-width: 210px; }
@media (max-width: 767.98px) {
  .table th, .table td { font-size: 0.94rem; }
  .table td { min-width: 150px; }
  #articleEditor, #categoryDescription, #manualPromptText, #createEnglishBody, #createBulgarianBody, #openAiSuggestCategoryTemplateInput, #openAiSuggestArticleTemplateInput, #openAiBulkSeoStructureTemplateInput { min-height: 14rem; }
  .preview-shell { min-height: 60vh; }
}


.modal-actions { display:flex; gap:.5rem; flex-wrap:wrap; align-items:center; }
.modal-actions .modal-action-btn { width:auto; flex:0 1 auto; }
@media (max-width: 767.98px) {
  .modal-actions {
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    gap: .4rem;
  }
  .modal-actions .modal-action-btn {
    width: auto;
    flex: 1 1 calc(50% - .4rem);
    min-width: 0;
    padding: .42rem .55rem;
    font-size: .875rem;
    line-height: 1.2;
    white-space: normal;
  }
}
@media (max-width: 420px) {
  .modal-actions {
    gap: .35rem;
  }
  .modal-actions .modal-action-btn {
    flex-basis: 100%;
    padding: .42rem .5rem;
    font-size: .84rem;
  }
}

#loadingOverlay{position:fixed;inset:0;background:rgba(17,24,39,.72);z-index:3000;display:flex;align-items:center;justify-content:center;padding:1rem}
#loadingOverlay.d-none{display:none!important}
.loading-overlay-inner{color:#fff;text-align:center;max-width:28rem}

.create-item-compact textarea{min-height:10rem!important}
#createItemModal .modal-dialog.modal-md{max-width:720px}
#createItemModal .modal-dialog.modal-lg{max-width:900px}
#confirmModalBody pre{white-space:pre-wrap;word-break:break-word;background:#f8fafc;padding:1rem;border-radius:.75rem;max-height:45vh;overflow:auto}
#requestModalFields .form-label{font-weight:600}
#requestModalFields textarea{min-height:10rem}

/* v21 modal layering polish */
.modal-backdrop.show{opacity:.65;}
.modal.show .modal-content{box-shadow:0 1rem 3rem rgba(0,0,0,.35);}
#createItemModal .modal-content{border:2px solid rgba(13,110,253,.12);}


.modal-underlay .modal-content{opacity:.38; filter:grayscale(.12); transform:scale(.985);}
#requestModal, #confirmModal{z-index:1085;}
#requestModal + .modal-backdrop, #confirmModal + .modal-backdrop{z-index:1080;}
@media (max-width: 767.98px) {
  .modal-actions {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.4rem;
    width:100%;
  }
  .modal-actions .modal-action-btn {
    width:100%;
    flex:initial;
    min-width:0;
    padding:.38rem .45rem;
    font-size:.82rem;
    line-height:1.15;
  }
}
@media (max-width: 420px) {
  .modal-actions {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:.35rem;
  }
  .modal-actions .modal-action-btn {
    padding:.34rem .42rem;
    font-size:.79rem;
  }
}


/* v26 mobile compact buttons */
.modal-actions .text-secondary{white-space:normal;}
.modal-actions .me-md-auto{flex:1 1 100%;}
.modal-actions .modal-action-btn i{margin-right:.25rem!important;}
@media (max-width: 767.98px){
  .modal-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:.3rem;width:100%;}
  .modal-actions .me-md-auto{grid-column:1/-1;margin:0!important;}
  .modal-actions .modal-action-btn{padding:.32rem .35rem!important;font-size:.75rem!important;line-height:1.1!important;border-radius:.55rem!important;}
}
@media (max-width: 430px){
  .modal-actions{grid-template-columns:repeat(2,minmax(0,1fr));}
}

/* v27 article footer + compact mobile actions */
.article-modal-footer{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:.55rem;
  align-items:stretch;
}
.article-modal-footer .article-footer-stats{
  grid-column:1 / -1;
  display:flex;
  flex-direction:column;
  gap:.2rem;
  padding-right:0;
}
.article-modal-footer .modal-action-btn{
  width:100%;
  min-width:0;
}
#articleSeoStats{line-height:1.35; white-space:normal;}
#articleSeoStats .seo-inline{display:inline-flex;align-items:center;gap:.25rem;margin-right:.5rem;white-space:nowrap;}
#articleSeoStats .seo-pill{display:inline-flex;align-items:center;justify-content:center;width:1rem;height:1rem;border-radius:999px;font-size:.72rem;}
#articleSeoStats .seo-pill-ok{color:#198754;}
#articleSeoStats .seo-pill-no{color:#dc3545;}
@media (max-width: 767.98px){
  .article-modal-footer{grid-template-columns:repeat(2,minmax(0,1fr));gap:.45rem;}
  .article-modal-footer .modal-action-btn{padding:.42rem .45rem!important;font-size:.79rem!important;line-height:1.15!important;}
  .article-modal-footer .article-preview-btn{order:90;grid-column:1;}
  .article-modal-footer #saveArticleBtn{order:91;grid-column:2;}
}
@media (max-width: 430px){
  .article-modal-footer{grid-template-columns:repeat(2,minmax(0,1fr));gap:.38rem;}
  .article-modal-footer .modal-action-btn{padding:.38rem .38rem!important;font-size:.76rem!important;}
}
