/* ============================================================
   Article Constructor — Editor UI Styles
   ============================================================ */

@font-face {
    font-family: 'Venryn';
    src: url('VenrynSans-Regular.woff?v=1.0.3') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Venryn Bold';
    src: url('VenrynSans-SemiBold.woff?v=1.0.3') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif; font-size: 14px; color: #1a1a1a; background: #f0f2f5; }

/* --- Header --- */
.header {
    display: flex; align-items: center; gap: 12px;
    height: 56px; padding: 0 14px;
    background: #fff; border-bottom: 1px solid #ddd; z-index: 100;
}
.header-title { font-size: 16px; font-weight: 700; white-space: nowrap; color: #333; }
.header-left { width: 220px; min-width: 220px; }
.header-center { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; }
.header-title-input {
    flex: 1; min-width: 0; padding: 6px 8px; border: none; background: transparent;
    font-size: 14px; outline: none;
}
.header-title-input:focus { color: #333; }

/* --- Title & Domain hint wrappers --- */
.hint-wrapper--title {
    display: flex; align-items: center;
    flex: 1; min-width: 120px;
    border: 1px solid #ccc; border-radius: 6px;
    background: #fff; transition: border-color .2s;
    overflow: hidden;
}
.hint-wrapper--title:focus-within { border-color: #4a90d9; }

.hint-wrapper--domain {
    display: flex; align-items: center;
    width: 230px;
    border: 1px solid #ccc; border-radius: 6px;
    background: #fff; transition: border-color .2s;
    overflow: hidden;
}
.hint-wrapper--domain:focus-within { border-color: #4a90d9; }

.header-slug-input {
    flex: 1; min-width: 0; padding: 6px 8px; border: none; background: transparent;
    font-size: 13px; color: #666; outline: none;
}
.header-slug-input:focus { color: #333; }

/* --- Slug wrapper with hint & copy --- */
.slug-wrapper {
    display: flex; align-items: center;
    width: 155px; border: 1px solid #ccc; border-radius: 6px;
    background: #fff; transition: border-color .2s;
    overflow: hidden;
}
.slug-wrapper:focus-within { border-color: #4a90d9; }

.slug-hint {
    flex-shrink: 0; padding: 0 7px;
    color: #aaa; font-size: 13px; cursor: default;
    position: relative;
}
.slug-hint:hover { color: #4a90d9; }

/* Tooltip */
.slug-hint::after {
    content: attr(title);
    position: absolute; top: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e; color: #fff;
    font-size: 11px; line-height: 1.4;
    padding: 7px 10px; border-radius: 6px;
    width: 240px; white-space: normal; text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    pointer-events: none; opacity: 0;
    transition: opacity .15s;
    z-index: 9999;
}
.slug-hint::before {
    content: '';
    position: absolute; top: calc(100% + 3px); left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent; border-bottom-color: #1a1a2e;
    pointer-events: none; opacity: 0;
    transition: opacity .15s;
    z-index: 9999;
}
.slug-hint:hover::after,
.slug-hint:hover::before { opacity: 1; }

.slug-copy-btn {
    flex-shrink: 0; padding: 0 8px; height: 100%;
    background: transparent; border: none; border-left: 1px solid #e8e8e8;
    color: #aaa; font-size: 13px; cursor: pointer;
    transition: color .15s, background .15s;
    display: flex; align-items: center;
}
.slug-copy-btn:hover { color: #4a90d9; background: #f0f6ff; }
.slug-copy-btn.copied { color: #27ae60; }
.header-domain-input {
    flex: 1; min-width: 0; padding: 6px 8px; border: none; background: transparent;
    font-size: 13px; color: #666; outline: none;
}
.header-domain-input:focus { color: #333; }
.header-right { display: flex; flex-shrink: 0; gap: 5px; }
.header-right .btn { padding: 7px 10px; min-width: 36px; justify-content: center; }

/* --- Buttons --- */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 16px; border: none; border-radius: 6px;
    font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .15s, transform .1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: #4a90d9; color: #fff; }
.btn-primary:hover { background: #3a7bc8; }
.btn-secondary { background: #e8ecf1; color: #333; }
.btn-secondary:hover { background: #d5dbe3; }
.btn-icon { font-family: monospace; font-size: 14px; }

.btn-sm {
    padding: 4px 10px; font-size: 12px; border-radius: 4px;
}
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-ghost { background: transparent; color: #666; border: 1px solid #ddd; }
.btn-ghost:hover { background: #f5f5f5; }

/* --- Main Layout --- */
.main {
    display: flex; height: calc(100vh - 56px); overflow: hidden;
}

/* --- Left Panel --- */
.panel-left {
    width: 220px; min-width: 220px; background: #fff;
    border-right: 1px solid #ddd; overflow-y: auto; padding: 12px 10px;
}
.panel-title {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: #999; margin-bottom: 12px;
}
.block-buttons { display: flex; flex-direction: column; gap: 4px; }
.block-btn {
    display: flex; align-items: center; gap: 8px;
    width: 100%; min-height: 34px; padding: 5px 8px; border: 1px solid #e0e0e0;
    border-radius: 6px; background: #fafafa; cursor: pointer;
    font-size: 12px; color: #333; transition: all .15s; text-align: left;
}
.block-btn:hover { background: #e8f0fe; border-color: #4a90d9; color: #4a90d9; }
.block-btn-icon {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 4px;
    background: #e8ecf1; font-weight: 700; font-size: 12px; color: #555;
    flex-shrink: 0;
}
.block-btn:hover .block-btn-icon { background: #4a90d9; color: #fff; }
.block-btn-label {
    flex: 1;
    min-width: 0;
    white-space: normal;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

/* --- Workspace --- */
.workspace {
    flex: 1; overflow-y: auto; padding: 24px; background: #f0f2f5;
}
.workspace-empty {
    display: flex; align-items: center; justify-content: center;
    height: 200px; color: #aaa; font-size: 15px; border: 2px dashed #ddd;
    border-radius: 10px; margin-bottom: 16px;
}
.blocks-container { display: flex; flex-direction: column; gap: 12px; }

/* --- Block Card --- */
.block-card {
    background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
    overflow: hidden; transition: box-shadow .15s, border-color .15s;
}
.block-card:hover { border-color: #4a90d9; box-shadow: 0 2px 8px rgba(74,144,217,.12); }
.block-card.dragging { opacity: .4; border-style: dashed; }
.block-card.drag-over { border-color: #4a90d9; box-shadow: 0 0 0 2px rgba(74,144,217,.25); }

.block-header {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #f8f9fa; border-bottom: 1px solid #eee;
}
.drag-handle {
    cursor: grab; color: #bbb; font-size: 16px; user-select: none;
    padding: 2px 4px; line-height: 1;
}
.drag-handle:active { cursor: grabbing; }
.block-type-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: #888; flex: 1;
}
.block-actions { display: flex; gap: 4px; }
.block-action-btn {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border: none; border-radius: 4px;
    background: transparent; cursor: pointer; font-size: 14px; color: #888;
    transition: all .15s;
}
.block-action-btn:hover { background: #e8ecf1; color: #333; }
.block-action-btn.delete:hover { background: #fde8e8; color: #e74c3c; }

.block-body { padding: 12px; }

/* --- Block Content Preview (in workspace) --- */
.block-preview { font-size: 13px; line-height: 1.6; color: #444; }
.block-preview h1 { font-size: 20px; margin: 0; }
.block-preview h2 { font-size: 17px; margin: 0; }
.block-preview h3 { font-size: 15px; margin: 0; }
.block-preview p { margin: 0; }
.block-preview blockquote {
    border-left: 3px solid #4a90d9; padding: 8px 12px; margin: 0;
    background: #f0f4ff; border-radius: 0 4px 4px 0; font-style: italic; color: #555;
}
.block-preview .table-responsive { overflow-x: auto; }
.block-preview table { width: 100%; border-collapse: collapse; font-size: 12px; }
.block-preview th, .block-preview td { border: 1px solid #ddd; padding: 5px 8px; text-align: left; }
.block-preview th { background: #f5f5f5; font-weight: 600; }
.block-preview ul, .block-preview ol { padding-left: 20px; margin: 0; }
.block-preview img.img-responsive { max-width: 100%; max-height: 120px; border-radius: 4px; }
.block-preview .link-preview { color: #4a90d9; text-decoration: underline; }
.block-preview details { border: 1px solid #ddd; border-radius: 4px; padding: 8px; }
.block-preview summary { cursor: pointer; font-weight: 600; }
.block-preview .menu-content-title { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.block-preview .ogli3 { list-style-type: disc; padding-left: 16px; }
.block-preview a.anchor { color: #4a90d9; text-decoration: none; }

.grid-workspace { display: flex; flex-direction: column; gap: 10px; }
.grid-workspace-help {
    background: #f7fbff; border: 1px solid #d7e8fb; border-radius: 6px;
    color: #45627d; font-size: 12px; line-height: 1.45; padding: 8px 10px;
}
.grid-workspace-row { margin-left: -6px; margin-right: -6px; }
.grid-workspace-row > [class*="col-"] { padding-left: 6px; padding-right: 6px; }
.grid-column-drop {
    min-height: 86px; border: 1px dashed #cfd8e3; border-radius: 6px;
    background: #fbfcfe; padding: 8px; transition: border-color .15s, background .15s;
}
.grid-column-drop.grid-column-over { border-color: #4a90d9; background: #edf6ff; }
.grid-column-head,
.grid-child-head {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    color: #7b8794; font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.grid-column-remove,
.grid-child-remove {
    border: none; background: transparent; color: #aaa; cursor: pointer;
    font-size: 16px; line-height: 1; padding: 0 2px;
}
.grid-column-remove:hover,
.grid-child-remove:hover { color: #e74c3c; }
.grid-column-empty {
    color: #a5b0bb; font-size: 12px; text-align: center;
    padding: 18px 6px;
}
.grid-child-card {
    background: #fff; border: 1px solid #e5e9ef; border-radius: 5px;
    margin-top: 8px; padding: 7px; cursor: grab;
}
.grid-child-card.dragging { opacity: .45; }
.grid-child-preview {
    margin-top: 6px; max-height: 160px; overflow: hidden;
    color: #444; font-size: 12px;
}
.grid-help {
    background: #f7fbff; border: 1px solid #d7e8fb; border-radius: 6px;
    color: #45627d; font-size: 12px; line-height: 1.45; padding: 8px 10px;
}

.row {
    margin-left: -15px;
    margin-right: -15px;
}
.row:before,
.row:after {
    content: " ";
    display: table;
}
.row:after { clear: both; }
[class*="col-xs-"],
[class*="col-md-"] {
    position: relative;
    min-height: 1px;
    padding-left: 15px;
    padding-right: 15px;
}
.col-xs-6,
.col-xs-12 { float: left; }
.col-xs-6 { width: 50%; }
.col-xs-12 { width: 100%; }
@media (min-width: 992px) {
    .col-md-3,
    .col-md-4,
    .col-md-6,
    .col-md-8,
    .col-md-9,
    .col-md-12 { float: left; }
    .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.33333333%; }
    .col-md-6 { width: 50%; }
    .col-md-8 { width: 66.66666667%; }
    .col-md-9 { width: 75%; }
    .col-md-12 { width: 100%; }
}

/* --- Edit Form (inside block) --- */
.edit-form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; gap: 8px; align-items: flex-start; }
.form-group { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.form-group label { font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; }
.form-group input,
.form-group textarea,
.form-group select {
    padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 13px; font-family: inherit; outline: none; transition: border-color .15s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: #4a90d9; }
.form-group textarea { resize: vertical; min-height: 60px; }
.form-group select { cursor: pointer; }

.textarea-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 6px;
}
.textarea-tools input {
    width: 54px;
    padding: 3px 6px;
    font-size: 11px;
}
.textarea-tools .btn {
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.4;
}
.textarea-tools-hint {
    color: #777;
    font-size: 11px;
}

.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }

/* --- Table editor --- */
.table-editor { width: 100%; }
.table-editor table { width: 100%; border-collapse: collapse; }
.table-editor th, .table-editor td { border: 1px solid #ddd; padding: 2px; }
.table-editor input {
    width: 100%; border: none; padding: 4px 6px; font-size: 12px;
    outline: none; background: transparent;
}
.table-editor input:focus { background: #f0f4ff; }
.table-editor .th-input { font-weight: 600; background: #f8f9fa; }
.table-editor-actions { display: flex; gap: 6px; margin-top: 6px; }

/* --- Tabs editor --- */
.tabs-editor { display: flex; flex-direction: column; gap: 8px; }
.tab-editor-item {
    border: 1px solid #eee; border-radius: 4px; padding: 8px;
    display: flex; flex-direction: column; gap: 6px;
}
.tab-editor-header { display: flex; gap: 6px; align-items: center; }
.tab-editor-header input { flex: 1; }

/* --- FAQ editor --- */
.faq-editor { display: flex; flex-direction: column; gap: 10px; }
.faq-editor-item {
    border: 1px solid #e8e8e8; border-radius: 6px; padding: 10px;
    display: flex; flex-direction: column; gap: 6px;
    background: #fdfdfd;
}
.faq-editor-header { display: flex; gap: 6px; align-items: center; }
.faq-editor-header input { flex: 1; }
.faq-editor-num {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: #5446f8; color: #fff; font-size: 11px; font-weight: 700;
    flex-shrink: 0;
}

/* --- Drop indicator --- */
.drop-indicator {
    height: 3px; background: #4a90d9; border-radius: 2px;
    margin: -6px 0; transition: opacity .15s;
}

/* --- Right Panel: Preview --- */
.panel-right {
    width: 450px; min-width: 450px; background: #fff;
    border-left: 1px solid #ddd; overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column; padding: 0;
}
body.preview-hidden .panel-right {
    display: none;
}
body.preview-hidden .workspace {
    max-width: none;
}
.panel-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky; top: 0; z-index: 10;
    flex-shrink: 0;
}
.panel-action-btn:hover {
    color: #5446f8 !important;
}
.btn-preview-toggle {
    white-space: nowrap;
}

.preview-toggle-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: none; border: 1px solid #ddd; border-radius: 5px;
    color: #888; cursor: pointer; font-size: 12px; font-weight: 500;
    padding: 3px 9px; transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
}
.preview-toggle-btn:hover {
    color: #5446f8 !important; border-color: #5446f8; background: #f3f2ff;
}
.preview-toggle-btn.is-hidden {
    color: #27ae60 !important; border-color: #27ae60; background: #f0faf5;
}
.preview-toggle-btn.is-hidden:hover {
    color: #219a52 !important; border-color: #219a52; background: #e0f5ea;
}
.preview-content {
    font-size: 14px; line-height: 1.6; color: #333;
    padding: 16px; flex: 1;
}
.preview-empty { color: #aaa; font-style: italic; }

/* Fullscreen Mode for Preview */
.panel-right.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    min-width: 100vw;
    background: #fff;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: none;
}
.panel-right.fullscreen .panel-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    flex-shrink: 0;
    position: sticky; top: 0; z-index: 10;
}
.panel-right.fullscreen .preview-content {
    flex: 1;
    overflow-y: auto;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px 60px 20px;
}

/* Preview article styles (mirror of exported CSS) */
.preview-content {
    --description-font: 'Venryn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --description-font-bold: 'Venryn Bold', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --background_main_color: #F3F2FF;
    --background_additional_color: #F9F8FF;
    --accent_background_color: #5446f8;
    --main_color: #1A1A1A;
    --additional_color: #3e3e3e;
}

/* TOC Container */
.preview-content .blog-content {
    background-color: var(--background_main_color, #F3F2FF);
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 25px;
}
.preview-content .blog-content .menu-content-title {
    font-family: var(--description-font-bold), sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--main_color, #1A1A1A);
    margin: 0px;
    padding: 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.preview-content .blog-content ul {
    list-style-type: disc;
    padding: 0px 0px 0px 25px;
    margin: 15px 0px 10px;
}
.preview-content .blog-content ul li {
    margin-bottom: 5px;
}
.preview-content .blog-content ul li a.anchor {
    color: var(--main_color, #1A1A1A);
    text-decoration: none;
    font-family: var(--description-font), sans-serif;
    font-size: 14px;
    transition: color 0.2s;
}
.preview-content .blog-content ul li a.anchor:hover {
    color: var(--accent_background_color, #5446f8);
    text-decoration: underline;
}
.preview-content .blog-content .ogli3 {
    list-style-type: circle;
    padding: 0px 0px 0px 25px;
    margin: 15px 0px 0px;
}

/* Description container */
.preview-content .description {
    font-family: var(--description-font), sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--main_color, #1A1A1A);
    text-align: justify;
}
.preview-content .description h1 {
    font-family: var(--description-font-bold), sans-serif;
    font-size: 32px;
    font-weight: 500;
    margin: 0 0 20px 0;
    color: #2c2c2c;
    line-height: 1.2;
}
.preview-content .description h2 {
    font-family: var(--description-font-bold), sans-serif;
    font-size: 27px;
    font-weight: 500;
    margin: 20px 0px 25px;
    color: #2c2c2c;
    line-height: 1.2;
    padding-bottom: 0;
    border-bottom: none;
    text-align: left;
}
.preview-content .description h3 {
    font-family: var(--description-font-bold), sans-serif;
    font-size: 21px;
    font-weight: 500;
    margin: 20px 0px 10px;
    color: #2c2c2c;
    line-height: 1.2;
    text-align: left;
}
.preview-content .description p {
    margin: 0 0 10px 0;
    text-indent: 15px;
    line-height: 1.5;
}
.preview-content .description .article-grid-row {
    margin-top: 20px;
    margin-bottom: 20px;
}
.preview-content .description .article-grid-row p:first-child {
    margin-top: 0;
}
.preview-content .description b, 
.preview-content .description strong {
    font-family: var(--description-font-bold), sans-serif;
    font-weight: 500;
}
.preview-content .description blockquote {
    font-family: var(--description-font), sans-serif;
    font-size: 16px;
    margin: 30px 0px;
    padding: 10px 20px;
    border-left: 5px solid var(--accent_background_color, #5446f8);
    background: transparent;
    border-top: none;
    border-right: none;
    border-bottom: none;
    border-radius: 0;
    font-style: normal;
    color: var(--main_color, #1A1A1A);
}
.preview-content .description .table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
}
.preview-content .description table {
    width: 100%;
    border-collapse: collapse;
    font-size: 16px;
    text-align: left;
    line-height: 1.3;
    margin-bottom: 30px;
}
.preview-content .description th, 
.preview-content .description td {
    border: 1px solid var(--background_main_color, #F3F2FF);
    padding: 5px;
    text-align: left;
    font-size: 16px;
}
.preview-content .description th {
    background: var(--background_main_color, #F3F2FF);
    font-family: var(--description-font-bold), sans-serif;
    font-weight: 500;
}
.preview-content .description td {
    background: #ffffff;
}
.preview-content .description ul, 
.preview-content .description ol {
    margin: 0 0 10px 0;
    padding-left: 40px;
}
.preview-content .description li {
    margin-bottom: 0px;
    text-indent: 0px;
}
.preview-content .description img.img-responsive {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px auto;
}
.preview-content .description a {
    color: var(--accent_background_color, #5446f8);
    text-decoration: underline;
}
.preview-content .description a:hover {
    color: var(--accent_background_color, #5446f8);
    text-decoration: underline;
}

/* Details / Spoiler */
.preview-content .description details {
    margin-bottom: 5px;
    border: 1px solid var(--background_main_color, #F3F2FF);
    border-radius: 5px;
    background: var(--background_additional_color, #F9F8FF);
}
.preview-content .description details:last-child {
    margin-bottom: 0px;
}
.preview-content .description details summary {
    font-family: var(--description-font-bold), sans-serif;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    padding: 10px 30px;
    transition: color 0.2s;
    position: relative;
    list-style: none;
    background: transparent;
    border-bottom: none;
}
.preview-content .description details summary::-webkit-details-marker {
    display: none;
}
.preview-content .description details summary::after {
    content: "▶";
    font-size: 0.8em;
    left: 10px;
    color: var(--accent_background_color, #5446f8);
    transition: transform 0.2s;
    position: absolute;
    top: 13px;
}
.preview-content .description details[open] summary::after {
    content: "▼";
}
.preview-content .description details summary + p,
.preview-content .description details > *:not(summary) {
    padding: 5px 30px;
    background: rgb(255, 255, 255);
    margin: 0px;
    text-indent: 0px !important;
}
.preview-content .description details > p:last-child,
.preview-content .description details > ul:last-child,
.preview-content .description details > ol:last-child,
.preview-content .description details > dl:last-child {
    padding-bottom: 10px;
}

/* --- FAQ --- */
.preview-content .article-faq {
    margin: 20px 0;
}
.preview-content .article-faq-title {
    font-family: var(--description-font-bold), sans-serif;
    font-size: 27px;
    font-weight: 500;
    margin: 20px 0 15px;
    color: #2c2c2c;
    line-height: 1.2;
}
.preview-content .article-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.preview-content .article-faq-item {
    border: none;
    border-bottom: 1px solid #eaeaea;
    overflow: visible;
    transition: border-color 0.2s;
}
.preview-content .article-faq-item:hover {
    border-color: #cfd8dc;
}
.preview-content .article-faq-question {
    font-family: var(--description-font-bold), sans-serif;
    font-weight: 500;
    font-size: 16px !important;
    padding: 14px 48px 14px 16px !important;
    cursor: pointer;
    outline: none;
    display: flex !important;
    align-items: center !important;
    gap: 16px;
    transition: color 0.2s;
    background: transparent;
    position: relative !important;
    color: #2c2c2c;
    width: 100% !important;
    box-sizing: border-box !important;
}
.preview-content .article-faq-question:hover {
    background: transparent;
    color: #1a1a1a;
}
.preview-content .article-faq-question::before {
    content: "?";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #cfd8dc;
    color: #78909c;
    font-size: 14px;
    font-weight: 400;
    flex-shrink: 0;
    box-sizing: border-box;
}
.preview-content .article-faq-question::after {
    content: "" !important;
    position: absolute !important;
    right: 20px !important;
    left: auto !important;
    top: 50% !important;
    width: 8px !important;
    height: 8px !important;
    border-right: 1.5px solid #a0aab2 !important;
    border-bottom: 1.5px solid #a0aab2 !important;
    transform: translateY(-50%) rotate(45deg) !important;
    transition: transform 0.2s, border-color 0.2s;
}
.preview-content .article-faq-question:not(.collapsed)::after {
    transform: translateY(-50%) rotate(-135deg) !important;
}
.preview-content .collapse {
    display: none;
}
.preview-content .collapse.in {
    display: block !important;
}
.preview-content .article-faq-answer {
    padding: 0px 16px 16px 64px;
    background: transparent;
    font-size: 16px !important;
    line-height: 1.6;
    color: #555;
    border-top: none;
}
.preview-content .article-faq-answer p {
    margin: 0 0 8px 0;
}
.preview-content .article-faq-answer p:last-child {
    margin-bottom: 0;
}

/* --- Вкладки (Tabs) --- */
.preview-content .article-tabs {
    margin: 20px 0;
}
.preview-content .article-tabs-nav {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid #eee;
}
.preview-content .article-tabs-nav button {
    padding: 10px 20px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    transition: all .15s;
}
.preview-content .article-tabs-nav button.active {
    background: #fff;
    color: #4a90d9;
    border-color: #ddd;
    border-bottom-color: #fff;
    margin-bottom: -2px;
}
.preview-content .article-tabs-panels {
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
}
.preview-content .article-tabs-panel {
    padding: 16px 20px;
}

/* --- Кнопки / Ссылки попапа OpenCart --- */
.preview-content .btn-popup-action {
    display: inline-block;
    background: var(--accent_background_color, #5446f8);
    color: #fff;
    padding: 10px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-family: var(--description-font-bold), sans-serif;
    font-weight: 500;
    transition: background 0.2s, transform 0.1s;
}
.preview-content .btn-popup-action:hover {
    background: #3e30d6 !important;
    color: #fff !important;
    text-decoration: none !important;
}
.preview-content .btn-popup-action:active {
    transform: scale(0.98);
}
.preview-content .link-popup-action {
    color: var(--accent_background_color, #5446f8);
    text-decoration: underline;
    font-family: var(--description-font-bold), sans-serif;
    font-weight: 500;
}
.preview-content .link-popup-action:hover {
    color: var(--accent_background_color, #5446f8);
    text-decoration: underline;
}

/* --- Modal Overlay & Window --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; transition: opacity 0.2s ease;
}
.modal-window {
    background: #fff; width: 750px; max-width: 90vw; max-height: 85vh;
    border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    display: flex; flex-direction: column; overflow: hidden;
    animation: modalShow 0.25s ease-out;
}
@keyframes modalShow {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #eee;
    background: #fdfdfd;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: #333; margin: 0; }
.modal-close {
    background: none; border: none; font-size: 24px; color: #aaa;
    cursor: pointer; transition: color 0.15s; line-height: 1;
}
.modal-close:hover { color: #333; }
.modal-body {
    padding: 24px; overflow-y: auto; font-size: 14px; line-height: 1.6; color: #444; text-align: left;
}
.modal-body h3 { font-size: 15px; font-weight: 700; margin: 24px 0 10px; }
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 12px; text-indent: 0 !important; }
.modal-body ul, .modal-body ol { margin-bottom: 16px; padding-left: 20px; }
.modal-body li { margin-bottom: 8px; }
.modal-body code { background: #f5f5f5; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 13px; color: #c7254e; }
.modal-body blockquote {
    background: #f7f6ff; border-left: 4px solid #5446f8; padding: 12px 18px; margin: 16px 0; border-radius: 4px; font-size: 13.5px;
    border-top: none; border-bottom: none; border-right: none; text-indent: 0 !important;
}
.modal-body blockquote strong { color: #5446f8; }
.modal-body .download-box {
    background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 18px; margin: 12px 0 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.modal-body .download-box-text { flex: 1; }
.modal-body .download-box-title { font-weight: 700; font-size: 13px; color: #333; margin-bottom: 4px; }
.modal-body .download-box-desc { font-size: 11px; color: #777; }
.modal-body .btn-download-xml {
    background: #27ae60; color: #fff; padding: 8px 14px; border-radius: 6px; border: none; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s; white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.modal-body .btn-download-xml:hover { background: #219653; }

/* --- Donate button in panel left --- */
.donate-btn {
    background: #fff5f5 !important;
    border-color: #feb2b2 !important;
    color: #c53030 !important;
}
.donate-btn .block-btn-icon {
    background: #fed7d7 !important;
    color: #e53e3e !important;
}
.donate-btn:hover {
    background: #fff0f0 !important;
    border-color: #fc8181 !important;
    color: #9b2c2c !important;
}
.donate-btn:hover .block-btn-icon {
    background: #e53e3e !important;
    color: #fff !important;
}

/* --- Donate Modal Custom Styles --- */
.donate-modal-window {
    width: 500px;
    max-width: 95vw;
}

.donate-modal-body {
    padding: 20px;
}

.donate-intro {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff0f0 100%);
    border: 1px dashed #feb2b2;
    padding: 14px;
    border-radius: 8px;
}

.donate-icon-wrapper {
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(229, 62, 98, 0.12);
    flex-shrink: 0;
}

.donate-heart-pulse {
    font-size: 20px;
    color: #e53e3e;
    animation: heartPulse 1.4s infinite;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.18); }
    100% { transform: scale(1); }
}

.donate-text {
    font-size: 13px;
    line-height: 1.45;
    color: #4a5568;
    margin: 0 !important;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.payment-card {
    display: flex;
    align-items: center;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.payment-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e0;
}

.payment-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    margin-right: 14px;
    flex-shrink: 0;
}

.card-color-yoomoney {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.card-color-yoomoney-wallet {
    background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
}

.card-color-paypal {
    background: linear-gradient(135deg, #0079c1 0%, #00457c 100%);
}

.payment-card-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.payment-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
}

.payment-value-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.payment-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
    word-break: break-all;
}

.btn-copy-payment {
    background: #edf2f7;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.btn-copy-payment:hover {
    background: #e2e8f0;
    color: #1a202c;
}

.btn-copy-payment.copied {
    background: #c6f6d5;
    color: #22543d;
}

.payment-action-link {
    font-size: 11px;
    color: #5446f8;
    text-decoration: none;
    margin-top: 3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
    font-weight: 600;
}
.payment-action-link:hover {
    color: #3b2ebd;
    text-decoration: underline;
}

.donate-footer-note {
    font-size: 11px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f7fafc;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #edf2f7;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* --- Help Modal Tabs & Structure --- */
.help-modal-window {
    width: 756px;
    max-width: 95vw;
}

.help-tabs-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    padding: 0 10px;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.help-tabs-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.help-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.help-tab-btn:hover {
    color: #4a90d9;
    background: #f0f4ff;
}

.help-tab-btn.active {
    color: #4a90d9;
    border-bottom-color: #4a90d9;
    background: #fff;
}

.help-modal-body {
    padding: 20px 24px;
    height: 480px;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.help-steps-list {
    margin-bottom: 16px;
    padding-left: 20px;
}

.help-steps-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.help-table-guide {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 12px 0 16px;
    font-size: 12.5px;
}

.help-table-guide th:nth-child(1),
.help-table-guide td:nth-child(1) {
    width: 42%;
}

.help-table-guide th:nth-child(2),
.help-table-guide td:nth-child(2) {
    width: 28%;
}

.help-table-guide th:nth-child(3),
.help-table-guide td:nth-child(3) {
    width: 30%;
}

.help-table-guide th, 
.help-table-guide td {
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    text-align: left;
    word-break: break-word;
    overflow-wrap: break-word;
}

.help-table-guide code {
    white-space: pre-wrap;
    word-break: break-all;
}

.help-table-guide th {
    background: #f7fafc;
    font-weight: 700;
    color: #4a5568;
}

.help-example-box {
    background: #f7fafc;
    border: 1px solid #edf2f7;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
}

.help-example-input {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.help-example-output {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 10px;
    border-radius: 4px;
}
