/* =========================================
STYLE.CSS v3.68 - CLEANED & OPTIMIZED
========================================= */

:root {
    /* === ГЛОБАЛЬНЫЕ НАСТРОЙКИ ЦВЕТОВ И СВЕЧЕНИЯ === */
    --bg-body: #f4f6f9;
    --bg-module: #ffffff;
    --bg-input: #ffffff;
    --border-base: #eef0f5;
    --border-focus: #2196F3;
    --enable-glow: 0.8;
    --glow-shadow-alpha: 0.1;
    --radius: 12px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: #333;
    margin: 0;
    padding: 15px;
    line-height: 1.5;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* =========================================
КАРТОЧНАЯ СИСТЕМА (БАЗОВЫЙ МОДУЛЬ)
========================================= */
.card {
    background: var(--bg-module);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 20px;
    border: calc(1px * var(--enable-glow)) solid var(--border-base);
    overflow: visible !important;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-title {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* =========================================
БЛОК ЛИЦЕНЗИИ
========================================= */
.license-card {
    background: #f8f9fa;
    border-radius: var(--radius);
    border: calc(1px * var(--enable-glow)) solid var(--border-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 16px 20px;
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.license-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.license-brand-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.license-shield-icon {
    width: 18px;
    height: 18px;
    color: #475569;
}

.license-brand-name {
    font-weight: 700;
    font-size: 15px;
    color: #1e293b;
    letter-spacing: 0.3px;
}

.license-version-badge {
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    background: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    transition: all 0.3s ease;
}

.license-version-badge.ready {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
    animation: pulse-ready 2s infinite;
}

@keyframes pulse-ready {
    0%, 100% { box-shadow: 0 0 4px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 12px rgba(16, 185, 129, 0.6); }
}

.license-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #cbd5e1;
    transition: background-color 0.3s ease;
}

.status-active .status-dot { background-color: #10b981; }
.status-active .status-text { color: #059669; }
.status-inactive .status-dot { background-color: #ef4444; }
.status-inactive .status-text { color: #dc2626; }

.license-limit-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 13px;
}

.limit-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.limit-label { color: #64748b; font-weight: 400; }
.limit-value { color: #0f172a; font-weight: 500; font-size: 13px; }
.limit-value.lifetime { color: #059669; }

.license-expiry-group { text-align: right; }
.expiry-value { color: #059669; font-weight: 500; font-size: 13px; }
.expiry-value.expired { color: #ef4444; }
/* =========================================
   КНОПКА УВЕДОМЛЕНИЙ
   ========================================= */
.notif-toggle-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  vertical-align: middle;
  flex-shrink: 0;
}

.notif-toggle-btn svg {
  width: 12px;
  height: 12px;
}

.notif-toggle-btn:hover {
  border-color: #93c5fd;
  color: #64748b;
}

/* ✅ Включенное состояние (цвета как у .custom-option.selected) */
.notif-toggle-btn.active {
  background: #f0f7ff;
  color: #1976D2;
  border-color: #93c5fd;
}

.notif-toggle-btn.active:hover {
  background: #e0efff;
}

#licenseBlock.glow-active,
.license-card.glow-active,
#searchBlock.glow-active,
.search-card.glow-active {
    border-color: var(--border-focus) !important;
    z-index: 5;
    box-shadow:
        calc(0px * var(--enable-glow)) calc(0px * var(--enable-glow)) calc(8px * var(--enable-glow)) rgba(33, 150, 243, calc(var(--glow-shadow-alpha) * var(--enable-glow))),
        calc(0px * var(--enable-glow)) calc(0px * var(--enable-glow)) calc(16px * var(--enable-glow)) rgba(33, 150, 243, calc(0.1 * var(--enable-glow))) !important;
}

.license-card:not(.glow-active):hover,
.search-card:not(.glow-active):hover {
    border-color: var(--border-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* =========================================
КАРТОЧКА ПОИСКА
========================================= */
.search-card {
    background: var(--bg-module);
    border-radius: var(--radius);
    border: calc(1px * var(--enable-glow)) solid var(--border-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.form-section { margin-bottom: 0; }

.form-divider {
    height: 1px;
    background-color: var(--border-base);
    margin: 20px 0;
    width: 100%;
}

.search-footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid var(--border-base);
    text-align: center;
    font-size: 0.75rem;
    color: #999;
    line-height: 1.4;
}

/* =========================================
ЭЛЕМЕНТЫ ФОРМ
========================================= */
input[type="text"], select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-base);
    border-radius: var(--radius-sm);
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg-input);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    color: #333;
    margin: 0;
}

input:focus, select:focus {
    border-color: var(--border-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.period-selectors {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 10;
}

.custom-select {
    flex: 1;
    position: relative;
}

.custom-select-trigger {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-base);
    border-radius: var(--radius-sm);
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg-input);
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    margin: 0;
}

.custom-select-trigger::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    margin-left: 8px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.custom-select.open .custom-select-trigger {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.custom-select.open .custom-select-trigger::after {
    transform: rotate(-135deg);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-base);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 50vh;
    overflow-y: auto;
    display: none;
    z-index: 100;
}

.custom-select.open .custom-select-options {
    display: block;
}

.custom-option {
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.1s;
    font-size: 16px;
    color: #333;
}

.custom-option:hover,
.custom-option.selected {
    background-color: #f0f7ff;
    color: #1976D2;
}

.custom-select-options::-webkit-scrollbar { width: 6px; }
.custom-select-options::-webkit-scrollbar-track { background: transparent; }
.custom-select-options::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 3px; }

/* =========================================
ВЫПАДАЮЩИЙ СПИСОК ПОИСКА
========================================= */
.search-wrapper {
    position: relative;
    z-index: 100;
    overflow: visible !important;
}

.suggestions-box {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #eee;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1001;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.suggestions-box::-webkit-scrollbar { width: 6px; }
.suggestions-box::-webkit-scrollbar-track { background: transparent; }
.suggestions-box::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 3px; }

.suggestion-item {
    padding: 10px 15px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.1s;
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item:active { background-color: #f0f7ff; }
.suggestion-item:hover .sug-label { color: #1976D2; }

.sug-label {
    display: block;
    font-weight: 400;
    font-size: 0.9em;
    color: #333;
    word-break: break-word;
    line-height: 1.3;
}

.sug-sub { display: none; }

/* =========================================
КАРТОЧКА ЭМИТЕНТА (единый стиль с .card)
========================================= */
.emitter-info {
    background: var(--bg-module);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 20px;
    margin-bottom: 20px;
    border: calc(1px * var(--enable-glow)) solid var(--border-base);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.emitter-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--border-focus, #2196F3);
}

.emitter-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.emitter-name {
    font-size: 1.1em;
    font-weight: bold;
    color: #222;
    word-break: break-word;
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

/* =========================================
МОДУЛЬ ФИНАНСОВОЕ СОСТОЯНИЕ
========================================= */
.financial-content {
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
}

.financial-placeholder {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
}

/* =========================================
МОДУЛЬ ЛИКВИДНОСТЬ
========================================= */
.liquidity-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 768px) {
    .liquidity-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .liquidity-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .metric-item {
        padding: 12px 8px;
    }
    
    .metric-value { font-size: 1.25em; }
    .metric-label { font-size: 0.7em; }
}

@media (max-width: 360px) {
    .liquidity-metrics {
        grid-template-columns: 1fr;
    }
}

.metric-item {
    position: relative;
    background: var(--bg-input, #ffffff);
    padding: 16px;
    border-radius: var(--radius-sm, 8px);
    text-align: center;
    border: 1px solid var(--border-base, #eef0f5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.metric-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--border-focus, #2196F3);
}

.metric-label {
    display: block;
    font-size: 0.75em;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.3;
}

.metric-value {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.metric-value.norm { color: #059669; }
.metric-value.bad { color: #dc2626; }

.metric-norm {
    display: block;
    font-size: 0.75em;
    color: #94a3b8;
    margin-top: 6px;
    font-weight: 400;
}

/* =========================================
БЛОК ПЛАТЁЖЕСПОСОБНОСТИ
========================================= */
.solvency-block {
    position: relative;
    margin-top: 20px;
    padding: 16px 40px;
    background: var(--bg-input, #ffffff);
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border-base, #eef0f5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.solvency-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--border-focus, #2196F3);
}

.solvency-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.solvency-header .metric-label {
    font-size: 0.75em;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 0;
    line-height: 1.3;
    text-align: left;
}

.solvency-header .metric-value {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
}

.progress-track {
    position: relative;
    width: calc(100% + 60px);
    margin-left: -30px;
    height: 12px;
    background: linear-gradient(90deg, 
        #ef4444 0%,
        #f59e0b 50%,
        #10b981 100%
    );
    border-radius: 6px;
    overflow: visible;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.solvency-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    width: calc(100% + 20px);
    margin-left: -10px;
    padding: 0 4px;
    box-sizing: border-box;
}

.progress-thumb {
    position: absolute;
    top: -8px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 13px solid #ffffff;
    transform: translateX(-50%);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    pointer-events: none;
}

.progress-norm-marker {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 20px;
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.solvency-footer .metric-norm {
    display: inline-block;
    margin-top: 0;
    font-size: 0.75em;
    color: #94a3b8;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

/* =========================================
МОДАЛЬНЫЕ ОКНА
========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease-out;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-module);
    padding: 30px;
    border-radius: var(--radius);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-base);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-title {
    margin: 0 0 12px 0;
    padding-bottom: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 2px solid var(--border-focus, #2196F3);
    line-height: 1.3;
    text-align: left;
}

.modal-title.error { color: #d32f2f; }

.modal-text {
    color: #555;
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.modal-text a {
    color: var(--border-focus);
    text-decoration: none;
}

.modal-text a:hover { text-decoration: underline; }

.modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-base);
    border-radius: var(--radius-sm);
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg-input);
    color: #333;
    text-align: center;
    letter-spacing: 1px;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin: 0 0 15px 0;
    box-sizing: border-box;
    height: auto;
}

.modal-input:focus {
    border-color: var(--border-focus);
    outline: none;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.modal-btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5;
    transition: background 0.2s, transform 0.1s;
    box-sizing: border-box;
}

.modal-btn:active { transform: scale(0.98); }
.modal-btn-full { width: 100%; }
.modal-btn-secondary { background: #f1f5f9; color: #333; }
.modal-btn-secondary:hover { background: #e2e8f0; }
.modal-btn-primary { background: var(--border-focus); color: white; font-weight: bold; }
.modal-btn-primary:hover { background: #1976D2; }

/* =========================================
КРЕСТИКИ ЗАКРЫТИЯ
========================================= */
.tooltip-content,
.trend-modal-content {
    position: relative;
    text-align: left;
}

.tooltip-close-icon,
.trend-close-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    padding: 0;
    line-height: 1;
    z-index: 10;
}

.tooltip-close-icon:hover,
.trend-close-icon:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.05);
}

/* =========================================
МОДАЛЬНОЕ ОКНО ТРЕНДА
========================================= */
.trend-modal-overlay {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.trend-modal-content {
    max-width: 520px;
    gap: 12px !important;
}

.trend-modal-content .modal-title {
    margin-bottom: 0 !important;
}

.trend-chart-container {
    margin: 8px 0 12px 0;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid var(--border-base);
}

.trend-svg { display: block; }

.trend-norm-line {
    stroke: #ff0000;
    stroke-width: 1.0;
    opacity: 1.0;
    /*filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));*/
}

.trend-norm-label {
    fill: #ff0000;
    font-size: 10px;
    font-weight: 600;
}

/* =========================================
TOOLTIP СТИЛИ
========================================= */
.tooltip-overlay {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

.tooltip-content {
    max-width: 420px;
    padding: 24px;
    gap: 12px !important;
}

.tooltip-content .modal-title {
    margin-bottom: 0 !important;
}

.tooltip-content .modal-text {
    margin-bottom: 0 !important;
}

.tooltip-title {
    font-size: 1.1rem;
    color: #1e293b;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-focus, #2196F3);
    line-height: 1.4;
}

.tooltip-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 20px;
}

.tooltip-close-btn { min-width: 120px; }

/* =========================================
ИКОНКИ В КАРТОЧКАХ
========================================= */
.icon-btn {
    position: absolute;
    bottom: 10px;
    width: 18px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, transform 0.15s, opacity 0.2s;
    z-index: 2;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    color: #94a3b8;
    opacity: 0.7;
	touch-action: manipulation; 
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.icon-btn:hover {
    color: #2196F3;
    opacity: 1;
}

.icon-btn:active { transform: scale(0.95); }

.icon-trend { left: 10px; }
.icon-info { right: 10px; }

.solvency-block .icon-trend,
.solvency-block .icon-info {
    bottom: 12px;
}

/* =========================================
УВЕДОМЛЕНИЯ (TOASTS)
========================================= */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 15px;
    z-index: 10001 !important;;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: #fff;
    color: #333;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid #2196F3;
    animation: slideIn 0.3s ease-out forwards;
    min-width: 250px;
    max-width: 400px;
    pointer-events: auto;
}

.toast.error { border-left-color: #E91E63; }
.toast.warning { border-left-color: #FF9800; }

@media (min-width: 768px) {
    #toast-container {
        left: auto;
        right: 20px;
        max-width: 400px;
        width: auto;
    }
}

@media (max-width: 767px) {
    #toast-container {
        left: 15px;
        right: 15px;
    }
    
    .toast { max-width: 100%; }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in-active {
    animation: fadeIn 0.8s ease-out forwards;
}

/* =========================================
ПРЕДУПРЕЖДЕНИЯ
========================================= */
.warning-message {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    border-radius: 6px;
    color: #856404;
    font-size: 0.9em;
    line-height: 1.5;
}

.warning-message p { margin: 0; }

/* =========================================
АДАПТАЦИЯ
========================================= */
@media (max-width: 480px) {
    .trend-modal-content,
    .tooltip-content {
        max-width: 95%;
        padding: 20px;
    }
    
    .trend-values {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tooltip-title { font-size: 1rem; }
    .tooltip-text { font-size: 0.9rem; }
}

/* =========================================
   STICKY HEADER (появляется при прокрутке)
========================================= */
.sticky-header {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    height: auto;
    padding: 10px 20px;
    width: calc(100% - 30px);   /* как body padding: 15px * 2 */
    max-width: 800px;           /* как .container */
    box-sizing: border-box;
	background: #f8fafc;
    border-bottom: 1px solid #cfe8fc;
    border-radius: 0 0 var(--radius, 12px) var(--radius, 12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transform: translate(-50%, -100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.sticky-header.visible {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

.sticky-header-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    max-width: 100%;
    text-align: center;
}

.sticky-company-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--border-focus, #2196F3);
    line-height: 1.3;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.sticky-period {
    font-size: 0.8rem;
    font-weight: 400;
	color: var(--border-focus, #2196F3);
    opacity: 0.85;
    line-height: 1.25;
    max-width: 100%;
    white-space: normal;
}

/* =========================================
МОДУЛЬ ФИНАНСОВОЕ СОСТОЯНИЕ И УСТОЙЧИВОСТЬ
========================================= */
.financial-stability-content {
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
}

.stability-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 600px) {
    .stability-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Карточка пончика — наследует стиль metric-item */
.stability-card.metric-item {
    position: relative;
    background: var(--bg-input, #ffffff);
    padding: 16px 12px 40px; /* дополнительный отступ снизу для иконок */
    border-radius: var(--radius-sm, 8px);
    text-align: center;
    border: 1px solid var(--border-base, #eef0f5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 220px;
}

.stability-card.metric-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--border-focus, #2196F3);
}

.stability-title {
    margin: 0 0 8px 0;
    font-size: 0.75em;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.3;
    width: 100%;
}

.donut-chart-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 180px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-svg {
    width: 100%;
    height: auto;
    display: block;
    max-height: 180px;
}

/* Иконки позиционируются как в metric-item */
.stability-card .icon-btn {
    position: absolute;
    bottom: 10px;
}

.stability-card .icon-trend {
    left: 10px;
}

.stability-card .icon-info {
    right: 10px;
}

/* =========================================
ИНДИКАТОР СБАЛАНСИРОВАННОСТИ
========================================= */
.balance-indicator {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.9em;
    font-weight: 500;
}

.balance-icon {
    position: absolute;
    left: 16px;
    font-size: 1.2em;
    font-weight: 500;
}

.balance-text {
    text-align: center;
}

.balance-unbalanced {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

.balance-text strong {
    font-weight: 400;
}

@media (max-width: 768px) {
    .balance-indicator {
        flex-direction: column;
        gap: 6px;
        text-align: center;
    }
}

/* =========================================
МОДУЛЬ УСТОЙЧИВОСТЬ ЭМИТЕНТА
========================================= */
.sustainability-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 10px;
}
.sustainability-card-full {
    grid-column: 1 / -1;
    position: relative;
    background: var(--bg-input, #ffffff);
    padding: 16px 0 32px; /* Уменьшен padding сверху и снизу */
    border-radius: var(--radius-sm, 8px);
    text-align: center;
    border: 1px solid var(--border-base, #eef0f5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.sustainability-card-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--border-focus, #2196F3);
}

/* ✅ SVG-график: уменьшен отступ сверху */
.sustainability-pyramid {
    width: 100%;/*calc(100% -16px);*/
	padding: 0 10px 0 10px;
    /*margin-left: 10px;*/
    display: block;
   /* margin-top: 8px; /* Было 8px, стало 4px */
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .sustainability-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   К ПОИСКУ — плавающая круглая кнопка
========================================= */
.back-to-search {
    position: fixed;
    bottom: 12px;
    right: 15px;
    z-index: 9990;
    display: none;
    margin: 0;
    width: auto;
    opacity: 0;
    transform: scale(0.8) translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.back-to-search.visible {
    display: block;
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.back-to-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #1e293b;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.back-to-search-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.back-to-search-btn:hover {
    background: #f8fafc;
    color: var(--border-focus, #2196F3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.1);
}

.back-to-search-btn:active {
    transform: scale(0.92);
}

/* =========================================
   ПОДПИСКА НА ПУШ (ПРИВЕДЕНО К ОБЩЕМУ СТИЛЮ)
========================================= */

.push-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 12px;
}

/* ✅ Надпись приведена к стилю .limit-label (как у "Баланс токенов") */
.push-toggle-label {
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
}

/* ✅ Тоггл сделан компактнее (36x20 вместо 48x28) */
.push-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

/* ✅ Включенное состояние — светлое, как .custom-option.selected в поиске */
.push-toggle.on {
    background: #f0f7ff;
    border-color: #93c5fd;
}

/* Кружок тоггла */
.push-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, background 0.2s ease;
}

/* Кружок в включенном состоянии — синий, как текст выбранной компании */
.push-toggle.on .push-toggle-knob {
    transform: translateX(16px);
    background: #2196F3/*#1976D2;*/
}

/* Компактный переключатель отслеживания */
.watch-toggle {
    position: relative;
    width: 36px;
    height: 20px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}
	
.watch-toggle:hover {
    border-color: #93c5fd;
}

.watch-toggle.active {
    background: #f0f7ff;
    border-color: #93c5fd;
}

.watch-toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, background 0.2s ease;
}


.watch-toggle.active .watch-toggle-knob {
    transform: translateX(16px);
    background: #2196F3;
}

/* Заблокированное состояние (визуальное, клик при этом работает) */
.watch-toggle.is-disabled,
.watch-toggle[aria-disabled="true"] {
    opacity: 1; /* Чуть более заметно, чем 0.35 */
    cursor: not-allowed;
    /* pointer-events здесь нет, поэтому клик проходит в JS */
}

/* Убираем эффект наведения для заблокированной кнопки */
.watch-toggle.is-disabled:hover,
.watch-toggle[aria-disabled="true"]:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}


.emitter-details-grid {
    display: grid;
    gap: 12px;
}

.detail-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 0.75em;
    color: #1976D2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 0.95em;
    color: #333;
    word-break: break-word;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .emitter-details-grid {
        grid-template-columns: 1fr 1fr;
        column-gap: 20px;
    }
}

/* =========================================
МОДУЛЬ ЛИСП РЕЙТИНГ
========================================= */
.lisp-rating-content {
    font-size: 0.95em;
    line-height: 1.6;
    color: #444;
}

/* Объединённая карточка */
.lisp-invest-card {
    position: relative;
    background: var(--bg-input, #ffffff);
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border-base, #eef0f5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 20px 10px 40px; /* увеличен padding-bottom для иконки */
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lisp-invest-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: var(--border-focus, #2196F3);
}

/* Большой рейтинг */
.rating-value {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 2px;
    transition: color 0.3s ease;
    margin-bottom: 10px;
	text-shadow: 1.5px 1.5px 5px rgba(0, 0, 0, 0.3);
}

/* Инвестиционный уровень — зелёный */
.rating-investment {
    color: #10b981;
}

/* Спекулятивный уровень — оранжевый */
.rating-speculative {
    color: #f59e0b;
}

/* Высокий риск — красный */
.rating-high-risk {
    color: #ef4444;
}

/* Разделительная полоса */
.lisp-rating-divider {
    height: 1px;
    background: var(--border-base, #eef0f5);
    margin: 16px 0;
}

/* Заголовок "История рейтингов" */
.rating-history-title {
    display: block;
    font-size: 0.75em;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.3;
    text-align: center;
}

/* Сетка карточек истории */
.rating-history-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

/* Карточка года с рейтингом */
.lisp-history-cell {
    background: var(--bg-input, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm, 8px);
    padding: 12px 8px;
    text-align: center;
}

/* Год */
.lisp-history-year {
    display: block;
    font-size: 0.8em;
    color: #94a3b8;
    margin-bottom: 6px;
    font-weight: 400;
}

/* Рейтинг */
.lisp-history-value {
    display: block;
    font-size: 1.1em;
    font-weight: 700;
    color: #444;
    line-height: 1.2;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .rating-value {
        font-size: 3rem;
    }
    
    .rating-history-grid {
        gap: 6px;
    }
    
    .lisp-history-cell {
        padding: 10px 4px;
    }
    
    .lisp-history-year {
        font-size: 0.7em;
    }
    
    .lisp-history-value {
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .rating-history-grid {
        gap: 4px;
    }
    
    .lisp-history-cell {
        padding: 8px 2px;
    }
    
    .lisp-history-year {
        font-size: 0.65em;
    }
    
    .lisp-history-value {
        font-size: 0.85em;
    }
}

/* =========================================
БЛОК ИНВЕСТИЦИОННЫЙ РИСК
========================================= */
.risk-block {
    position: relative;
    margin-top: 20px;
    padding: 16px 10px 40px;
}

.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
    padding: 0 30px; /* добавлен padding по бокам */
}

.risk-label {
    font-size: 0.75em;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1.3;
}

.risk-value {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.2;
    /* цвет задаётся inline через style */
}

/* Прогресс-бар с градиентом */
.risk-track {
    position: relative;
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg,
        #ef4444 0%,
        #f97316 20%,
        #eab308 40%,
        #84cc16 60%,
        #10b981 80%,
        #059669 100%
    );
    border-radius: 6px;
    overflow: visible;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Маркер позиции УИР */
.risk-thumb {
    position: absolute;
    top: -8px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 13px solid #ffffff;
    transform: translateX(-50%);
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)) drop-shadow(0 0 1px rgba(0, 0, 0, 0.8));
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    pointer-events: none;
}

.risk-grades {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    width: 100%;
}

.risk-grade {
    font-size: 0.7em;
    color: #64748b;
    font-weight: 500;
    text-align: center;
    flex: 0;
}

/* Адаптивные подписи риска */
/* По умолчанию (все экраны): показываем максимальный, умеренный, минимальный */
.risk-grade:nth-child(2),
.risk-grade:nth-child(4) {
    display: none;
}

/* Текст уровня риска — стиль как у "Порог надёжности" */
.risk-level-text {
    position: absolute;
    bottom: 16px;
    left: 10px;
    font-size: 0.75em;
    color: #94a3b8;
    font-weight: 400;
    line-height: 1.2;
}

/* Иконка в блоке риска */
.risk-block .icon-info {
    bottom: 12px;
}

/* Телефон: показываем только максимальный и минимальный */
@media (max-width: 480px) {
    .risk-grade:nth-child(3) {
        display: none;
    }
}

/* =========================================
КНОПКА ЛИСП-ИИ (левый нижний угол)
========================================= */
.lisp-ai-button {
    position: fixed;
    bottom: 12px;
    left: 15px;
    z-index: 9990;
    display: none;
    margin: 0;
    width: auto;
    opacity: 0.6;
    transform: scale(0.8) translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    cursor: pointer;
}

.lisp-ai-button.visible {
    display: block;
    opacity: 0.6;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.lisp-ai-button:hover {
    opacity: 0.8;
}

.lisp-ai-button:active {
	transform: scale(0.92);
}

.lisp-ai-icon {
    width: 48px;
    height: 48px;
    display: block;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

@media (max-width: 768px) {
    .lisp-ai-button {
        bottom: 12px;
        left: 15px;
    }
    .lisp-ai-icon {
        width: 48px;
        height: 48px;
    }
}

/* =========================================
МОДУЛЬ ЛИСП ПРОГНОЗ
========================================= */
.default-forecast-content {
    font-size: 0.95em;
    /*line-height: 1.6;*/
    color: #444;
}

/* Спидометр */
.default-risk-gauge {
    width: 100%;
    max-width: 320px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Статус блокировки счетов — ПОД карточками */
.default-forecast-block-status {
    align-items: center;
    justify-content: center;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm, 8px);
    text-align: center;
    font-size: 0.75em;
    font-weight: 500;
    letter-spacing: 0.4px;
    /*text-transform: uppercase;*/
    border: 1px solid;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.default-forecast-block-status.not-blocked {
    background: #d1fae5;
    color: #065f46;
    border-color: #10b981;
}

.default-forecast-block-status.blocked {
    background: #fee2e2;
    color: #991b1b;
    border-color: #ef4444;
}

/* =========================================
СТРЕСС-ТЕСТ — ТАБЛИЦА
========================================= */
.stress-test-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 2px;
    margin-top: 8px;
    font-size: 0.85em;
}

.stress-test-table td {
    padding: 6px 4px;
    vertical-align: middle;
    background: transparent;
}

.stress-test-table td:first-child {
    text-align: left;
    color: #475569;
    font-weight: 400;
    line-height: 1.3;
    border-bottom: 1px solid #f1f5f9;
}

.stress-test-table td:last-child {
    text-align: right;
    color: #0f172a;
    font-weight: 400;
    white-space: nowrap;
    padding-left: 10px;
    border-bottom: 1px solid #f1f5f9;
    font-variant-numeric: tabular-nums;
}

.stress-test-table tr:last-child td {
    border-bottom: none;
}

.stress-value {
    font-variant-numeric: tabular-nums;
}
/* =========================================
   ПОПОЛНЕНИЕ ТОКЕНОВ (СБП)
========================================= */
.token-topup-content {
    max-width: 420px;
}

.token-topup-body {
    text-align: center;
}

.token-package-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.token-package-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-base, #e2e8f0);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-input, #f8fafc);
    cursor: pointer;
    font-size: 15px;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    box-sizing: border-box;
}

.token-package-btn:hover {
    border-color: var(--border-focus, #2196F3);
    background: #eff6ff;
}

.token-package-btn:active {
    transform: scale(0.98);
}

.token-package-count {
    font-weight: 600;
    color: #0f172a;
}

.token-package-price {
    font-weight: 700;
    color: var(--border-focus, #2196F3);
}

.token-qr-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px auto;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    max-width: 260px;
}

.token-qr-wrap svg,
.token-qr-img {
    width: 220px;
    height: 220px;
    max-width: 100%;
    display: block;
}

.token-qr-hint {
    font-size: 13px;
    color: #64748b;
    margin: 8px 0 12px;
}

.token-topup-spinner {
    width: 36px;
    height: 36px;
    margin: 16px auto;
    border: 3px solid #e2e8f0;
    border-top-color: var(--border-focus, #2196F3);
    border-radius: 50%;
    animation: tokenSpin 0.8s linear infinite;
}

@keyframes tokenSpin {
    to { transform: rotate(360deg); }
}

/* =========================================
МОДАЛЬНОЕ ОКНО ВЫБОРА ТАРИФА (КОМПАКТНОЕ)
========================================= */
.token-package-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.token-package-btn {
    position: relative;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    width: 100%;
    text-align: left;
    font-family: inherit;
    overflow: visible; /* изменено с hidden, чтобы бейдж не обрезался */
}

.token-package-btn:hover:not(:disabled) {
    border-color: #93c5fd;
    background: #f8fafc;
}

.token-package-btn:active:not(:disabled) {
    transform: scale(0.99);
}

.token-package-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Строка: название + цена */
.token-package-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
	top: 15px;
}

.token-package-name {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.token-package-price {
    font-size: 15px;
    font-weight: 600;
    color: #1976D2;
    white-space: nowrap;
    margin-right: 0px; /* ← СДВИГ ЦЕНЫ ЛЕВЕЕ, чтобы не перекрывалась бейджем */
	z-index: 3;
}

/* Бейдж экономии — сверху справа */
.package-save-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #dcfce7;
    color: #16a34a;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 2px;
    border-radius: 8px;
    line-height: 1.2;
    z-index: 1;
}

/* Бейдж "ВЫГОДНО" для безлимита */
.package-hot-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #ff9922 0%, #f44336 100%);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 0 6px 0 6px;
    letter-spacing: 0.3px;
    z-index: 2;
}

/* === БЕЗЛИМИТ === */
.token-package-btn.package-unlimited {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    padding: 12px 14px 10px 14px;
}

.token-package-btn.package-unlimited:hover:not(:disabled) {
    border-color: #059669;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.token-package-btn.package-unlimited .token-package-name {
    font-size: 15px;
    font-weight: 700;
}

.token-package-btn.package-unlimited .token-package-price {
    color: #059669;
    font-size: 16px;
}

/* Преимущества безлимита — 4 галочки в 2 колонки */
.unlimited-perks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(16, 185, 129, 0.2);
    font-size: 11px;
    color: #065f46;
    line-height: 1.3;
}

.unlimited-perks span {
    white-space: nowrap;
}

/* Правая колонка — прижата к правому краю */
.unlimited-perks span:nth-child(even) {
    text-align: right;
    justify-self: end;
}

/* Адаптация для очень маленьких экранов */
@media (max-width: 360px) {
    .token-package-btn {
        padding: 8px 12px;
    }
    .token-package-name { font-size: 13px; }
    .token-package-price { font-size: 14px; margin-right: 60px; }
    .unlimited-perks { font-size: 10px; gap: 3px 8px; }
}

/* =========================================
   МОДУЛЬ «МОИ ПОДПИСКИ»
========================================= */
.my-subscriptions-card {
    /* как обычная .card — те же padding / shadow / border */
    overflow: hidden !important;
}

.my-subscriptions-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 0;
    padding: 0 0 10px 0;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #eee;
    -webkit-tap-highlight-color: transparent;
    /* цвет и фон НЕ меняются при hover */
    color: #444;
    background: transparent;
}

.my-subscriptions-title:hover {
    color: #444;
    background: transparent;
}

.my-subs-title-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 700;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.my-subs-count {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 2px 8px;
    min-width: 22px;
    text-align: center;
}

.my-subs-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.my-subscriptions-card:not(.collapsed) .my-subs-chevron {
    transform: rotate(180deg);
}

.my-subscriptions-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 0;
}

.my-subscriptions-card:not(.collapsed) .my-subscriptions-body {
    max-height: 480px;
    opacity: 1;
	overflow-y: auto;
}

.my-subscriptions-card:not(.collapsed) .my-subscriptions-body {
	max-height: 320px;
}
.my-subscriptions-card:not(.collapsed) .my-subscriptions-body::-webkit-scrollbar {
	width: 6px;
}
.my-subscriptions-card:not(.collapsed) .my-subscriptions-body::-webkit-scrollbar-track {
	background: transparent;
}
.my-subscriptions-card:not(.collapsed) .my-subscriptions-body::-webkit-scrollbar-thumb {
	background-color: #ccc;
	border-radius: 3px;
}

.my-subs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

@media (min-width: 768px) {
    .my-subs-list {
        grid-template-columns: 1fr 1fr;
        column-gap: 0;
    }
}

.my-subs-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.1s;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f5f5f5;
    -webkit-tap-highlight-color: transparent;
}

.my-subs-item:last-child {
    border-bottom: none;
}

/* В двухколоночном режиме убираем нижнюю границу у предпоследнего,
   если элементов нечётное количество — опционально, можно оставить */
@media (min-width: 768px) {
    .my-subs-item:nth-last-child(2):nth-child(odd) {
        border-bottom: none;
    }
}

.my-subs-item:hover,
.my-subs-item:active {
    background-color: #f0f7ff;
}

.my-subs-item:hover .my-subs-item-name {
    color: #1976D2;
}

.my-subs-item-name {
    flex: 1;
    display: block;
    font-weight: 400;
    font-size: 0.9em;
    color: #333;
    word-break: break-word;
    line-height: 1.3;
}

.my-subs-item.active {
    background-color: #f0f7ff;
}

.my-subs-item.active .my-subs-item-name {
    color: #1976D2;
    font-weight: 400;
}