/* ========== SUBEROO STYLES v1.1.3 - 2024-02-28 ========== */
/* Обновления: Одинаковый размер всех плиток статистики (grid layout) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #f1f5f9;
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    /* Тело и заголовки — пропорциональный системный шрифт (лучше читаемость длинного текста) */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    /* Моно — только для чисел */
    --font-mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.container {
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    flex: 1;
}

header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0;
    backdrop-filter: blur(10px);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    gap: 15px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    margin-right: auto;
}

h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    background: linear-gradient(90deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    align-items: stretch;
}

.controls {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
}

.main-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

/* Кнопка только с иконкой */
.icon-btn {
    padding: 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    min-width: 40px;
    min-height: 40px;
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #d97706, #b45309);
}

.icon-btn:active {
    transform: translateY(0);
}

/* Тултип с информацией */
.info-tooltip {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    margin-left: 8px;
}

.info-tooltip i {
    font-size: 1.1rem;
    color: #64748b;
    transition: color 0.3s;
}

.info-tooltip:hover i {
    color: #94a3b8;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.8rem;
    max-width: 320px;
    white-space: normal;
    line-height: 1.5;
    z-index: 1000;
    transition: opacity 0.3s, visibility 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 12px;
    border: 5px solid transparent;
    border-top-color: #1e293b;
}

.info-tooltip:hover .tooltip-text,
.info-tooltip:focus-visible .tooltip-text,
.info-tooltip.is-open .tooltip-text {
    visibility: visible;
    opacity: 1;
}
/* Кнопка-тултип: сброс стилей кнопки + видимый фокус */
button.info-tooltip {
    background: transparent;
    border: none;
    padding: 2px;
    color: inherit;
    font: inherit;
}
.info-tooltip:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
    border-radius: 6px;
}

#addBtn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

#addBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, #2563eb, #1e40af);
}

#exportBtn {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid #22c55e;
    color: #22c55e;
}

#exportBtn:hover {
    background: rgba(34, 197, 94, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.2);
}

#shareBtn {
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid #eab308;
    color: #eab308;
}

#shareBtn:hover {
    background: rgba(234, 179, 8, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(234, 179, 8, 0.2);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: modalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    margin: auto;
}

/* Кастомный скроллбар для модальных окон */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-header h2 {
    color: #f8fafc;
    font-size: 1.6rem;
    font-weight: 700;
}

.close {
    font-size: 30px;
    cursor: pointer;
    color: #94a3b8;
    transition: all 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    flex-shrink: 0;
}

.close:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 10px;
    color: #cbd5e1;
    font-weight: 600;
    font-size: 0.95rem;
}

input, select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #334155;
    border-radius: 12px;
    color: #f8fafc;
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus, select:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 50px;
    cursor: pointer;
}

option {
    background: #1e293b;
    color: #f8fafc;
    padding: 12px;
}

.price-input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.period-selector {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 4px;
}

.period-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #94a3b8;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95rem;
    white-space: nowrap;
}

.period-btn:hover {
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.08);
}

.period-btn.active {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.price-input-wrapper {
    position: relative;
}

.price-input-wrapper input {
    padding-right: 60px;
}

.price-currency {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-weight: 600;
}

.price-hint {
    margin-top: 8px;
    padding: 10px 14px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    color: #93c5fd;
    font-size: 0.9rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    bottom: 0;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    z-index: 10;
}

.form-actions button {
    padding: 12px 28px;
    font-size: 1rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

#cancelBtn {
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid #475569;
}

#cancelBtn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

#saveBtn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

#saveBtn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* ========== МОДАЛЬНОЕ ОКНО ИНСАЙТОВ ========== */
.insights-modal-content {
    max-width: 700px;
}

.insights-content {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.7;
}

.insight-item {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid #60a5fa;
    border-radius: 10px;
}

.insight-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-left-color: #3b82f6;
}

.insight-item.highlight {
    border-left-color: #fbbf24;
    background: rgba(251, 191, 36, 0.05);
}

.insight-item.highlight:hover {
    background: rgba(251, 191, 36, 0.08);
    border-left-color: #f59e0b;
}

.insight-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.insight-item.highlight .insight-number {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.insight-text {
    flex: 1;
}

.insight-text strong {
    color: #60a5fa;
    font-weight: 700;
}

.insight-item.highlight .insight-text strong {
    color: #fbbf24;
}

.insights-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.insights-note {
    font-size: 0.8rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 10px;
    padding-left: 16px;
    border-left: 2px solid rgba(100, 116, 139, 0.3);
}

.insights-telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(96, 165, 250, 0.1);
}

.insights-telegram-link:hover {
    color: #3b82f6;
    background: rgba(96, 165, 250, 0.15);
    transform: translateX(4px);
}

/* ========== GRID LAYOUT ДЛЯ КАРТОЧЕК ========== */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0;
    border: none;
    align-content: start;
    grid-auto-flow: row dense;
    flex: 0 0 auto;
}

/* Когда в grid только empty-state, центрируем его */
.masonry-grid:has(.empty-state) {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    align-content: center !important;
    grid-template-columns: none !important;
    flex: 1;
}

/* Кастомный скроллбар */
.masonry-grid::-webkit-scrollbar {
    width: 8px;
}

.masonry-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.masonry-grid::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 10px;
}

.masonry-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

.subscription-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-radius: 14px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.subscription-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
}

.subscription-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #60a5fa, #c084fc);
    z-index: 1;
}

.subscription-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.02) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    pointer-events: none;
    z-index: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.service-icon {
    width: 36px;
    height: 36px;
    margin-right: 14px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.service-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.service-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    flex: 1;
    margin-right: 12px;
    max-height: 3.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.card-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    z-index: 2;
}

/* Кнопки в отдельной строке для маленьких карточек */
.card-actions-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 6px;
    z-index: 2;
}

.edit-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    flex-shrink: 0;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.edit-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    transform: scale(1.1);
}

.delete-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    flex-shrink: 0;
    z-index: 2;
    backdrop-filter: blur(10px);
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

.price-container {
    margin: 8px 0;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.monthly-price {
    font-size: var(--price-size, 1.7rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.yearly-price {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin-top: 4px;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 12px;
    min-height: 50px;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}

.percentage {
    font-size: 1.05rem;
    font-weight: 700;
    color: #cbd5e1;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.category {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
    max-width: none;
    text-align: center;
    flex-shrink: 1;
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.category-Развлечения {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.15));
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.3);
}

.category-Образование {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.15));
    color: #a7f3d0;
    border-color: rgba(16, 185, 129, 0.3);
}

.category-Софт {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.15));
    color: #bfdbfe;
    border-color: rgba(59, 130, 246, 0.3);
}

.category-Музыка {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.15));
    color: #ddd6fe;
    border-color: rgba(139, 92, 246, 0.3);
}

.category-Игры {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.15));
    color: #fde68a;
    border-color: rgba(245, 158, 11, 0.3);
}

.category-Связь {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(219, 39, 119, 0.15));
    color: #fbcfe8;
    border-color: rgba(236, 72, 153, 0.3);
}

.category-Банкинг {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(13, 148, 136, 0.15));
    color: #99f6e4;
    border-color: rgba(20, 184, 166, 0.3);
}

.category-Другое {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2), rgba(75, 85, 99, 0.15));
    color: #d1d5db;
    border-color: rgba(107, 114, 128, 0.3);
}

/* ========== FOOTER ========== */
.footer-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0;
    padding: 10px 15px;
    margin: 0;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.footer-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.footer-btn:active {
    transform: translateY(0);
}

.footer-icon-btn {
    padding: 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    min-width: 40px;
    min-height: 40px;
    text-decoration: none;
}

.footer-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.footer-icon-btn:active {
    transform: translateY(0);
}

/* ========== СТАТИСТИКА В HEADER ========== */
.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.stat-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(0,0,0,0.2));
    padding: 6px 8px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(0,0,0,0.3));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-value {
    font-size: 1.15rem;
    color: #60a5fa;
    margin-bottom: 2px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(96, 165, 250, 0.3);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: #cbd5e1;
    font-weight: 500;
    line-height: 1;
}

/* Кнопки действий в статистике */
.stat-action-btn {
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(0,0,0,0.2));
    padding: 6px 8px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.stat-action-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(0,0,0,0.3));
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.stat-action-btn i {
    font-size: 1.2rem;
    color: #fbbf24;
    margin-bottom: 2px;
}

.stat-action-btn.download-btn i {
    color: #10b981;
}

.stat-action-btn span {
    font-size: 0.65rem;
    color: #cbd5e1;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 20px;
    width: 100%;
    height: 100%;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
    color: #94a3b8;
}

.empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: #cbd5e1;
    font-weight: 600;
}

.empty-state p {
    color: #94a3b8;
    max-width: 350px;
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

/* ========== ПРЕСЕТЫ ========== */
.presets-screen {
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.presets-header {
    text-align: center;
}

.presets-header h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #f8fafc;
}

.presets-header p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.presets-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    max-width: 900px;
    width: 100%;
}

.preset-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.preset-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1), rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s;
}

.preset-card:hover {
    transform: translateY(-5px);
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.2);
}

.preset-card:hover::before {
    opacity: 1;
}

.preset-card.added {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

.preset-card.added::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
}

.preset-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

.preset-name {
    font-size: 0.85rem;
    color: #f1f5f9;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 1;
}

.preset-price {
    font-size: 0.75rem;
    color: #60a5fa;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.skip-presets-btn {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skip-presets-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #cbd5e1;
    transform: translateY(-2px);
}

.color-options {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px;
    margin-top: 10px;
    justify-items: center;
    width: 100%;
}

.form-group.color-picker-container .color-options {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
}

.color-option {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-option.selected {
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.4), 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 18px 28px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-left: 4px solid #10b981;
    border-radius: 12px;
    color: #f8fafc;
    font-weight: 600;
    z-index: 1001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(127, 29, 29, 0.9), rgba(69, 10, 10, 0.9));
}

.notification i {
    margin-right: 12px;
    color: #10b981;
    font-size: 1.2rem;
}

.notification.error i {
    color: #fca5a5;
}

.card-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #b8c4d6;
    text-decoration: none;
    transition: color 0.3s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-height: 1.5rem;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.card-link:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    text-decoration: none;
}

.card-link i {
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ========== СТИЛИ ДЛЯ 8 РАЗМЕРОВ КАРТОЧЕК ========== */

/* Размер 1: XS - самые маленькие */
/* Размерные классы size-* удалены: размер задаётся классом .is-wide и переменной --price-size */

/* ========== АДАПТИВНЫЕ СТИЛИ ========== */

/* Адаптивные колонки для сетки */
@media (min-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
    
    header {
        flex-direction: row;
    }
    
    .header-left {
        align-items: flex-start;
        text-align: left;
    }
    
    .controls {
        flex-direction: row;
        width: auto;
    }
    
    .main-btn {
        width: auto;
    }
}

@media (min-width: 1024px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

@media (min-width: 1400px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Адаптивность для модального окна */
@media (max-width: 768px) {
    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .presets-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .preset-logo {
        width: 60px;
        height: 60px;
    }
    
    .preset-name {
        font-size: 0.75rem;
    }
    
    header {
        gap: 12px;
    }
    
    .header-stats .stat-card {
        padding: 5px 6px;
    }
    
    .header-stats .stat-value {
        font-size: 0.9rem;
    }
    
    .header-stats .stat-label {
        font-size: 0.6rem;
    }
    
    .modal {
        padding: 10px;
        align-items: flex-start;
    }
    
    .modal-content {
        max-height: 85vh;
        padding: 20px;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.4rem;
    }
    
    .close {
        width: 35px;
        height: 35px;
        font-size: 26px;
    }
    
    .form-group {
        margin-bottom: 18px;
    }
    
    input, select {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
    .period-btn {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .price-hint {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions button {
        width: 100%;
        padding: 14px;
    }
    
    .color-options {
        gap: 8px;
        grid-template-columns: repeat(5, 1fr) !important;
    }
    
    .color-option {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 16px;
        border-radius: 16px;
    }
    
    .modal-header {
        padding-bottom: 15px;
        margin-bottom: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .color-options {
        grid-template-columns: repeat(5, 1fr) !important;
    }
    
    .color-option {
        width: 32px;
        height: 32px;
    }
    
    .period-selector {
        flex-direction: column;
    }
    
    .period-btn {
        padding: 12px;
    }
    
    label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }
    
    .color-options {
        gap: 6px;
        grid-template-columns: repeat(4, 1fr);
    }
    
    .color-option {
        width: 32px;
        height: 32px;
    }
    
    .form-actions {
        margin-top: 20px;
        padding-top: 15px;
    }
}

@media (max-width: 900px) {
    header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .header-left {
        align-items: center;
        text-align: center;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }
    
    .main-btn {
        width: 100%;
        justify-content: center;
    }
    
    .stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 8px;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    .card-footer {
        flex-direction: row;
        align-items: flex-end;
        gap: 10px;
        min-height: 45px;
    }
    .category {
        max-width: 100px;
        font-size: 0.78rem;
        padding: 5px 10px;
        min-width: 55px;
    }
    .percentage {
        font-size: 1.3rem;
        min-width: 45px;
    }
    .service-name {
        font-size: 1.3rem;
        -webkit-line-clamp: 2;
        max-height: 3.8rem;
        margin-bottom: 6px;
    }
    .monthly-price {
        font-size: 1.7rem;
    }
    .yearly-price {
        font-size: 0.85rem;
    }
    .service-icon {
        width: 32px;
        height: 32px;
        margin-right: 12px;
    }
    .service-icon img {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 600px) {
    header {
        padding: 10px 12px;
        gap: 10px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    .presets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .preset-card {
        padding: 15px;
    }
    
    .preset-logo {
        width: 50px;
        height: 50px;
    }
    
    .preset-name {
        font-size: 0.7rem;
    }
    
    .preset-price {
        font-size: 0.7rem;
    }
    
    .main-btn {
        font-size: 0.8rem;
        padding: 8px 14px;
    }
    
    header {
        flex-wrap: wrap;
    }
    
    .header-stats {
        width: 100%;
        order: 3;
        margin-top: 10px;
        gap: 6px;
        grid-template-columns: repeat(4, 1fr);
    }
    
    .header-stats .stat-card {
        padding: 8px 6px;
    }
    
    .header-stats .stat-value {
        font-size: 0.95rem;
    }
    
    .header-stats .stat-label {
        font-size: 0.65rem;
    }
    
    /* Кнопка установки как 4-я карточка в ряду статистики */
    .stat-action-btn {
        padding: 8px 6px;
        flex-direction: column;
        gap: 4px;
    }
    
    .stat-action-btn i {
        font-size: 1.1rem;
        margin-bottom: 0;
    }
    
    .stat-action-btn span {
        font-size: 0.65rem;
        text-align: center;
    }
    
    .footer-container {
        gap: 8px;
        padding: 10px 12px;
    }
    
    .footer-btn {
        font-size: 0.8rem;
        padding: 8px 14px;
    }
    
    .footer-icon-btn {
        min-width: 36px;
        min-height: 36px;
        font-size: 0.9rem;
    }
    
    .subscription-card {
        padding: 18px;
    }
    .service-name {
        font-size: 1.2rem;
        -webkit-line-clamp: 2;
        max-height: 3rem;
    }
    .monthly-price {
        font-size: 1.6rem;
    }
    .card-footer {
        min-height: 40px;
        gap: 8px;
        padding-top: 10px;
    }
    .percentage {
        font-size: 1.2rem;
        min-width: 40px;
    }
    .category {
        max-width: 90px;
        font-size: 0.75rem;
        padding: 4px 8px;
        min-width: 50px;
    }
}
/* ========== SUBEROO SEO-КОНТЕНТ ГЛАВНОЙ (namespace: sb-) v1.0 ========== */
.sb-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    width: 100%;
}
.sb-content section {
    margin-bottom: 40px;
}
.sb-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 14px;
    background: linear-gradient(90deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1.3;
}
.sb-content h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f1f5f9;
    margin: 18px 0 8px;
}
.sb-content p {
    font-size: 1rem;
    line-height: 1.75;
    color: #cbd5e1;
    margin-bottom: 12px;
}
.sb-content p strong { color: #f1f5f9; }
.sb-content a { color: #60a5fa; text-decoration: none; }
.sb-content a:hover { text-decoration: underline; }
.sb-lead {
    font-size: 1.05rem;
    color: #e2e8f0;
}
.sb-features {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin: 16px 0;
    padding: 0;
}
.sb-features li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #e2e8f0;
}
.sb-features li strong {
    display: block;
    margin-bottom: 4px;
    color: #f1f5f9;
}
.sb-faq details {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 4px 18px;
    margin-bottom: 10px;
}
.sb-faq summary {
    cursor: pointer;
    padding: 14px 0;
    font-weight: 600;
    color: #f1f5f9;
    list-style: none;
    position: relative;
    padding-right: 28px;
}
.sb-faq summary::-webkit-details-marker { display: none; }
.sb-faq summary::after {
    content: '+';
    position: absolute;
    right: 4px;
    top: 12px;
    font-size: 1.4rem;
    color: #60a5fa;
    transition: transform 0.2s;
}
.sb-faq details[open] summary::after { content: '\2212'; }
.sb-faq details p {
    padding-bottom: 14px;
    margin-bottom: 0;
}
.sb-author {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 20px 22px;
}
.sb-author h2 { font-size: 1.2rem; margin-bottom: 10px; }
.sb-note {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 8px;
}
@media (max-width: 600px) {
    .sb-content { padding: 28px 16px 44px; }
    .sb-content h2 { font-size: 1.3rem; }
}

/* ---------- Блок преимуществ (4 плитки) ---------- */
.sb-benefits {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 20px;
}
@media (max-width: 900px) {
    .sb-benefits { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
    .sb-benefits { grid-template-columns: 1fr; }
}
.sb-benefit {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.sb-benefit:hover {
    transform: translateY(-4px);
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.18);
}
.sb-benefit-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.35);
}
.sb-benefit h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 6px;
}
.sb-benefit p {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #94a3b8;
    margin: 0;
}

/* ---------- Фикс раскладки: футер прижат к низу страницы ---------- */
/* Грид больше не растягивается на весь экран (иначе футер всплывал в середину) */
.masonry-grid {
    flex: 0 0 auto;
}
/* SEO-контент занимает свою естественную высоту, футер уходит вниз */
.sb-content {
    flex: 0 0 auto;
}
.footer-container {
    margin-top: auto;
}


/* ===== Карточки: размер по цене (v1.2) ===== */
.subscription-card { min-height: 155px; }
.subscription-card.cw-2 { grid-column: span 2; }
.subscription-card.cw-3 { grid-column: span 3; }
.card-cat-bar { position: absolute; top: 0; left: 0; width: 100%; height: 5px; z-index: 2; }

/* Мобильные: одинаковые плитки, вес по цене отключаем */
@media (max-width: 768px) {
    .subscription-card.cw-2, .subscription-card.cw-3 { grid-column: auto; }
    .subscription-card { min-height: 150px; }
    .monthly-price { font-size: 1.5rem; }
}


/* ===== Карточки: читаемость шапки на узких плитках (v1.2) ===== */
.card-header { padding-right: 46px; min-height: 34px; }
.card-actions { position: absolute; top: 12px; right: 12px; z-index: 3; gap: 6px; margin: 0; }
.service-name {
    font-size: var(--name-size, 1.15rem);
    -webkit-line-clamp: 2;
    max-height: none;
}
/* На узких плитках фавикон только мешает названию — прячем его */
.subscription-card.cw-1 .service-icon { display: none; }

@media (max-width: 768px) {
    /* Мобильные: единый вид — показываем фавикон у всех, имя одного размера */
    .subscription-card .service-icon { display: flex; }
    .service-name { font-size: 1.15rem; }
}


/* ===== v1.3: типографика чисел, ховер-действия ===== */
/* Моноширинный — только для числовых значений */
.monthly-price, .yearly-price, .currency, .percentage,
.stat-value, .header-stats .stat-value { font-family: var(--font-mono); }

/* Кнопки правки/удаления: на устройствах с мышью показываем по наведению/фокусу,
   на тач-устройствах (нет hover) — всегда видимы */
@media (hover: hover) {
    .card-actions { opacity: 0; transition: opacity 0.2s ease; }
    .subscription-card:hover .card-actions,
    .subscription-card:focus-within .card-actions { opacity: 1; }
}