*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-body: #f0f2f5;
    --bg-container: #ffffff;
    --text-heading: #000000;
    --text-subtitle: #999999;
    --text-label: #333333;
    --input-bg: #ffffff;
    --input-border: #dddddd;
    --input-text: #000000;
    --preview-bg: #fafafa;
    --preview-border: #e0e0e0;
    --btn-primary-bg: #000000;
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #222222;
    --btn-outline-bg: #ffffff;
    --btn-outline-text: #000000;
    --btn-outline-border: #000000;
    --btn-outline-hover: #f5f5f5;
    --history-bg: #ffffff;
    --history-item-bg: #fafafa;
    --history-item-hover: #f0f0f0;
    --history-item-border: #eeeeee;
    --history-text: #333333;
    --history-time: #999999;
    --scrollbar-thumb: #cccccc;
    --scrollbar-track: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #1a1a1a;
        --bg-container: #2d2d2d;
        --text-heading: #ffffff;
        --text-subtitle: #888888;
        --text-label: #cccccc;
        --input-bg: #3d3d3d;
        --input-border: #555555;
        --input-text: #ffffff;
        --preview-bg: #333333;
        --preview-border: #555555;
        --btn-primary-bg: #ffffff;
        --btn-primary-text: #000000;
        --btn-primary-hover: #dddddd;
        --btn-outline-bg: #2d2d2d;
        --btn-outline-text: #ffffff;
        --btn-outline-border: #ffffff;
        --btn-outline-hover: #3d3d3d;
        --history-bg: #2d2d2d;
        --history-item-bg: #333333;
        --history-item-hover: #3d3d3d;
        --history-item-border: #444444;
        --history-text: #cccccc;
        --history-time: #777777;
        --scrollbar-thumb: #555555;
        --scrollbar-track: #333333;
    }
}

body.theme-light {
    --bg-body: #f0f2f5;
    --bg-container: #ffffff;
    --text-heading: #000000;
    --text-subtitle: #999999;
    --text-label: #333333;
    --input-bg: #ffffff;
    --input-border: #dddddd;
    --input-text: #000000;
    --preview-bg: #fafafa;
    --preview-border: #e0e0e0;
    --btn-primary-bg: #000000;
    --btn-primary-text: #ffffff;
    --btn-primary-hover: #222222;
    --btn-outline-bg: #ffffff;
    --btn-outline-text: #000000;
    --btn-outline-border: #000000;
    --btn-outline-hover: #f5f5f5;
    --history-bg: #ffffff;
    --history-item-bg: #fafafa;
    --history-item-hover: #f0f0f0;
    --history-item-border: #eeeeee;
    --history-text: #333333;
    --history-time: #999999;
    --scrollbar-thumb: #cccccc;
    --scrollbar-track: #f0f0f0;
}

body.theme-dark {
    --bg-body: #1a1a1a;
    --bg-container: #2d2d2d;
    --text-heading: #ffffff;
    --text-subtitle: #888888;
    --text-label: #cccccc;
    --input-bg: #3d3d3d;
    --input-border: #555555;
    --input-text: #ffffff;
    --preview-bg: #333333;
    --preview-border: #555555;
    --btn-primary-bg: #ffffff;
    --btn-primary-text: #000000;
    --btn-primary-hover: #dddddd;
    --btn-outline-bg: #2d2d2d;
    --btn-outline-text: #ffffff;
    --btn-outline-border: #ffffff;
    --btn-outline-hover: #3d3d3d;
    --history-bg: #2d2d2d;
    --history-item-bg: #333333;
    --history-item-hover: #3d3d3d;
    --history-item-border: #444444;
    --history-text: #cccccc;
    --history-time: #777777;
    --scrollbar-thumb: #555555;
    --scrollbar-track: #333333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-body);
    color: var(--text-heading);
    padding: 20px;
    transition: background 0.3s, color 0.3s;
}

.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.container {
    position: relative;
    background: var(--bg-container);
    padding: 32px;
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    width: 100%;
    max-width: 500px;
    transition: background 0.3s;
    flex-shrink: 0;
}

h1 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-heading);
}

.subtitle {
    font-size: 13px;
    color: var(--text-subtitle);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-label);
    margin-bottom: 6px;
}

textarea {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    font-family: monospace;
    background: var(--input-bg);
    color: var(--input-text);
    height: 70px;
    resize: vertical;
}

textarea::placeholder {
    color: var(--text-subtitle);
}

.input-type {
    font-size: 12px;
    color: var(--text-subtitle);
    margin-top: 4px;
    min-height: 18px;
}

/* Слайдеры */
.qr-scale-control {
    margin-bottom: 16px;
}

.qr-scale-control input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--input-border);
    outline: none;
    margin: 10px 0;
}

.qr-scale-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--btn-primary-bg);
    cursor: pointer;
    border: 2px solid var(--btn-primary-text);
    transition: all 0.2s;
}

.qr-scale-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.qr-scale-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--btn-primary-bg);
    cursor: pointer;
    border: 2px solid var(--btn-primary-text);
    transition: all 0.2s;
}

.qr-scale-control input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.preview {
    margin: 24px 0;
    padding: 20px;
    background: var(--preview-bg);
    border: 2px dashed var(--preview-border);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

#qrcode canvas {
    cursor: pointer;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-subtitle);
    opacity: 0.6;
    font-size: 14px;
    text-align: center;
    min-height: 256px;
}

.qr-placeholder-icon {
    width: 64px;
    height: 64px;
    border: 3px dashed var(--preview-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.qr-placeholder-text {
    font-size: 13px;
    max-width: 200px;
    line-height: 1.4;
}

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    /*min-width: 100px;*/
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    transition: background 0.2s, color 0.2s;
}

.btn-primary:hover {
    background: var(--btn-primary-hover);
}

.btn-outline {
    background: var(--btn-outline-bg);
    color: var(--btn-outline-text);
    border: 1px solid var(--btn-outline-border);
    transition: background 0.2s, color 0.2s;
}

.btn-outline:hover {
    background: var(--btn-outline-hover);
}

.btn-outline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--input-border);
    border-radius: 50%;
    background: var(--input-bg);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--preview-bg);
}

/* Панель оформления */
.design-panel {
    margin-bottom: 20px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 8px 12px;
    background: var(--preview-bg);
}

.design-panel summary {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-label);
    cursor: pointer;
    outline: none;
}

.design-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

.design-options .form-group {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.design-options .form-group label {
    margin-bottom: 0;
    flex: 1;
    min-width: 120px;
}

.design-options .form-group input[type="color"] {
    width: 40px;
    height: 30px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    cursor: pointer;
}

.design-options .form-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.design-options .form-group select {
    flex: 1;
    min-width: 120px;
    padding: 6px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    color: var(--input-text);
}

.design-options .form-group input[type="range"] {
    flex: 1;
    min-width: 120px;
}

.design-options .form-group input[type="file"] {
    flex: 1;
    min-width: 150px;
    font-size: 13px;
}

.small-btn {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    background: var(--btn-outline-bg);
    color: var(--btn-outline-text);
    border: 1px solid var(--btn-outline-border);
    cursor: pointer;
    transition: background 0.2s;
}

.small-btn:hover {
    background: var(--btn-outline-hover);
}

.contrast-warning {
    font-size: 12px;
    min-height: 18px;
    margin-top: 4px;
}

/* Панель закладок */
.history-panel {
    background: var(--history-bg);
    border-radius: 10px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    width: 280px;
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    transition: background 0.3s;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
}

.history-header {
    padding: 20px 20px 12px 20px;
    border-bottom: 1px solid var(--history-item-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
}

.history-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-add {
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
    background: none;
    border: 1px solid var(--history-item-border);
    border-radius: 4px;
    color: var(--history-time);
    cursor: pointer;
    flex: 0 0 auto;
    transition: color 0.15s, background 0.15s;
}

.history-add:hover {
    color: var(--text-heading);
    background: var(--history-item-hover);
}

.history-clear {
    font-size: 12px;
    color: var(--history-time);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    flex: 0;
}

.history-clear:hover {
    background: var(--history-item-hover);
    color: #ff4444;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

.history-item {
    position: relative;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    background: var(--history-item-bg);
    border: 1px solid var(--history-item-border);
    transition: background 0.15s, transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.history-item:hover {
    background: var(--history-item-hover);
}

.history-item.active {
    border-color: var(--text-heading);
    background: var(--history-item-hover);
}

.history-item-text {
    font-size: 13px;
    font-family: monospace;
    color: var(--history-text);
    word-break: break-all;
    line-height: 1.3;
    padding-right: 24px;
    cursor: text;
}

.history-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-time {
    font-size: 11px;
    color: var(--history-time);
}

.history-item-delete {
    font-size: 14px;
    color: var(--history-time);
    cursor: pointer;
    background: none;
    border: none;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    flex: 0;
}

.history-item-delete:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.history-item-pin-top {
    position: absolute;
    top: 6px;
    right: 11px;
    width: auto;
    height: auto;
    padding: 2px 2px;
    font-size: 17px;
    line-height: 1;
    background: none;
    border: none;
    color: var(--history-time);
    cursor: pointer;
    flex: 0 0 auto;
    display: inline-block;
    z-index: 1;
    transition: color 0.15s, background 0.15s;
}

.history-item.pinned .history-item-pin-top {
    color: #f0a500;
}

.history-item-pin-top:hover {
    color: #f0a500;
    background: rgba(240, 165, 0, 0.1);
}

.history-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--history-time);
    font-size: 13px;
}

/* Анимации */
@keyframes slideInUp {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.history-item.just-pinned {
    animation: slideInUp 0.3s ease-out;
}

.history-item.dragging {
    opacity: 0.4;
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
    cursor: grabbing;
}

/* Плейсхолдер при перетаскивании */
.drag-placeholder {
    border: 2px dashed var(--history-item-border);
    border-radius: 6px;
    margin: 4px 0;
    background: var(--history-item-hover);
    opacity: 0.6;
}

/* SEO-контент */
.seo-content {
    width: 100%;
    max-width: 800px;
    margin-top: 40px;
    padding-bottom: 60px;
}

.seo-container {
    background: var(--bg-container);
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    transition: background 0.3s;
}

.seo-container h2 {
    font-size: 20px;
    color: var(--text-heading);
    margin-bottom: 16px;
}

.seo-container h3 {
    font-size: 16px;
    color: var(--text-heading);
    margin-top: 24px;
    margin-bottom: 12px;
}

.seo-container p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-label);
    margin-bottom: 12px;
}

.seo-container ul,
.seo-container ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.seo-container li {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-label);
    margin-bottom: 6px;
}

.seo-container strong {
    color: var(--text-heading);
}

.seo-container em {
    color: var(--text-subtitle);
}

/* Лайтбокс */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    padding: 40px;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    pointer-events: none;
}

/* Шапка */
.site-header {
    width: 100%;
    background: var(--bg-container);
    border-bottom: 1px solid var(--history-item-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    margin-bottom: 20px;
    transition: background 0.3s;
}

.header-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.site-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-heading);
    text-decoration: none;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.header-tagline {
    font-size: 12px;
    color: var(--text-subtitle);
    letter-spacing: 0.2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav a {
    font-size: 14px;
    color: var(--text-label);
    text-decoration: none;
    transition: color 0.15s;
}

.site-nav a:hover {
    color: var(--text-heading);
}

.site-nav a.active, .footer-column a.active{
    color: var(--text-heading);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Кнопка темы */
.theme-toggle {
    width: 36px;
    height: 36px;
    border: 1px solid var(--input-border);
    border-radius: 50%;
    background: var(--input-bg);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.3s, border-color 0.3s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--preview-bg);
}

/* Раскрывающийся список */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    list-style: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-label);
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.dropdown-toggle::-webkit-details-marker {
    display: none;
}

.dropdown-toggle:hover {
    color: var(--text-heading);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg-container);
    border: 1px solid var(--history-item-border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    padding: 8px 0;
    z-index: 100;
}

.dropdown-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    color: var(--text-label);
    text-decoration: none;
    transition: background 0.15s;
}

.dropdown-menu a:hover {
    background: var(--history-item-hover);
    color: var(--text-heading);
}

/* Футер */
.site-footer {
    width: 100%;
    background: var(--bg-container);
    border-top: 1px solid var(--history-item-border);
    margin-top: 40px;
    padding: 20px 0;
    transition: background 0.3s;
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 13px;
    color: var(--history-time);
}

.footer-columns {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-column {
    min-width: 160px;
}

.footer-column h4 {
    font-size: 14px;
    color: var(--text-heading);
    margin-bottom: 10px;
    font-weight: 600;
}

.footer-column a {
    display: block;
    color: var(--history-time);
    text-decoration: none;
    margin-bottom: 6px;
    transition: color 0.15s;
}

.footer-column a:hover {
    color: var(--text-heading);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    border-top: 1px solid var(--history-item-border);
    padding-top: 16px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    color: var(--history-time);
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid var(--history-item-border);
    border-radius: 4px;
    transition: color 0.15s, border-color 0.15s;
}

.footer-social a:hover {
    color: var(--text-heading);
    border-color: var(--text-heading);
}

/* Адаптивность */
@media (max-width: 800px) {
    .main-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .history-panel {
        width: 100%;
        max-width: 500px;
        max-height: 300px;
        position: static;
    }

    .container {
        max-width: 100%;
    }

    .seo-container {
        padding: 20px;
    }
}

@media (max-width: 500px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 22px;
    }

    .actions {
        flex-direction: column;
    }

    .preview {
        padding: 10px;
    }

    .history-item-pin-top {
        width: 44px;
        height: 44px;
        top: 4px;
        right: 4px;
        font-size: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .history-item-text {
        padding-right: 48px;
    }

    .history-item-delete {
        width: 44px;
        height: 44px;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .history-item-meta {
        padding-right: 0;
    }

    .header-container {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .site-nav {
        gap: 16px;
        flex-wrap: wrap;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
    }

    .design-options .form-group {
        flex-direction: column;
        align-items: flex-start;
    }
    .design-options .form-group label {
        margin-bottom: 4px;
    }
}

/* Для дисплеев с высотой 720 и меньше */
@media (max-height: 720px) {
    body {
        padding: 10px 20px;
    }

    .site-header {
        margin-bottom: 10px;
    }

    .site-footer {
        margin-top: 10px;
        padding: 10px 0;
    }

    .main-wrapper {
        gap: 10px;
    }

    .container {
        padding: 20px;
    }

    .history-panel {
        max-height: calc(100vh - 40px);
    }

    .preview {
        min-height: 150px;
        padding: 10px;
        margin: 10px 0;
    }

    #qrcode canvas {
        max-width: 100%;
        max-height: 40vh;
        width: auto !important;
        height: auto !important;
        object-fit: contain;
    }

    .form-group {
        margin-bottom: 8px;
    }

    .actions {
        gap: 8px;
    }

    button {
        padding: 8px 12px;
        font-size: 13px;
    }

    .history-header {
        padding: 10px 15px 8px;
    }

    .history-list {
        padding: 4px;
    }

    .history-item {
        padding: 6px 8px;
    }

    .header-container {
        min-height: 48px;
    }

    .site-logo {
        font-size: 18px;
    }

    .header-tagline {
        font-size: 11px;
    }
}

@media (max-width: 500px) and (max-height: 720px) {
    .preview {
        min-height: 120px;
    }

    #qrcode canvas {
        max-height: 50vh;
    }

    .header-container {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

    .site-nav {
        gap: 16px;
        flex-wrap: wrap;
    }

    .dropdown-menu {
        right: auto;
        left: 0;
    }

    .footer-columns {
        flex-direction: column;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Кнопки форматирования текста */
.format-buttons .button-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.format-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--text-heading);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
    min-width: 0; /* переопределяем min-width:100px из общих стилей */
}

.format-btn.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
}

.format-btn:hover {
    background: var(--preview-bg);
}