/* type: uploaded file
fileName: paulownia-calc-extended/assets/style.css
*/
/* ISOLATION & RESET */
#psel-app {
    width: 100%; max-width: 1000px; margin: 20px auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #212529; box-sizing: border-box;
    --pice-radius: 10px;
}
#psel-app * { box-sizing: border-box; }
#psel-app .hidden { display: none !important; }

/* SECTIONS WRAPPER */
.psel-settings-wrapper, .psel-results-wrapper {
    background-color: #f8f9fa; border-radius: 12px; padding: 20px;
    margin-bottom: 25px; border: 1px solid #e9ecef;
    position: relative;
}
.psel-section-label {
    position: absolute; top: -12px; left: 20px;
    background: #6c757d; color: #fff; padding: 2px 10px;
    font-size: 0.75rem; border-radius: 4px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}

/* HEADINGS */
#psel-app h1 { text-align: center; font-size: 1.8rem; margin-bottom: 5px; line-height: 1.2; font-weight: 800; }
#psel-app h3 { font-size: 1.2rem; margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; }
#psel-app h4 { margin: 0 0 10px 0; font-size: 1rem; font-weight: 700; }
#psel-app p { text-align: center; color: #6c757d; margin-bottom: 15px; font-size: 0.95rem; }

/* THEMES */
#psel-app[data-theme="industrial"] { --pice-primary: #198754; }
#psel-app[data-theme="industrial"] .psel-main-card { background-color: #f4fbf6; border: 1px solid #198754; }

#psel-app[data-theme="buyback"] { --pice-primary: #0d6efd; }
#psel-app[data-theme="buyback"] .psel-main-card { background-color: #f0f7ff; border: 1px solid #0d6efd; }

#psel-app[data-theme="custom"] { --pice-primary: #fd7e14; }
#psel-app[data-theme="custom"] .psel-main-card { background-color: #fff9f2; border: 1px solid #fd7e14; }

/* UTILS */
#psel-app .text-primary { color: var(--pice-primary) !important; }
#psel-app .text-accent { color: #dc3545 !important; }

/* INFO GRID */
#psel-app .psel-info-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px;
}
#psel-app .psel-info-box {
    background: rgba(255,255,255,0.8); border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px; padding: 10px; text-align: center;
}
#psel-app .psel-info-title { font-size: 0.8rem; color: #666; margin-bottom: 4px; }
#psel-app .psel-info-val { font-size: 1.1rem; font-weight: 800; color: var(--pice-primary); }

#psel-app .psel-custom-area-row,
#psel-app .psel-info-area-row {
    text-align: center; margin-bottom: 15px; font-size: 0.95rem; color: #444;
}
#psel-app .psel-info-area-row strong { font-size: 1.1rem; color: #000; }

/* MAIN CARD */
#psel-app .psel-main-card {
    background: #fff; border-radius: var(--pice-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03); margin-bottom: 20px; overflow: hidden;
    transition: background-color 0.3s, border-color 0.3s;
}
#psel-app .psel-card-title-wrap { padding: 15px 25px; border-bottom: 1px solid rgba(0,0,0,0.05); background: rgba(255,255,255,0.6); }
#psel-app .psel-controls-body { padding: 20px 10px; }

/* BUTTONS */
#psel-app .psel-mode-switcher {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px; padding: 20px 0;
}
#psel-app .psel-mode-btn {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px; background: #fff; border: 1px solid #ddd; border-radius: 10px;
    cursor: pointer; transition: all 0.2s ease; text-align: left; appearance: none;
    width: 100%; position: relative; box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
#psel-app .psel-mode-btn:hover { border-color: #aaa; transform: translateY(-2px); }
#psel-app .psel-mode-btn.active {
    border-color: var(--pice-primary); box-shadow: 0 0 0 2px var(--pice-primary); background: #fff; z-index: 2;
}
#psel-app .btn-icon-wrap { width: 32px; height: 32px; color: #adb5bd; flex-shrink: 0; }
#psel-app .psel-mode-btn.active .btn-icon-wrap { color: var(--pice-primary); }
#psel-app .psel-mode-btn strong { display: block; font-size: 0.95rem; color: #000; margin-bottom: 2px; line-height: 1.2; }
#psel-app .psel-mode-btn span { font-size: 0.75rem; color: #6c757d; line-height: 1.1; }

/* INPUTS & SLIDER */
#psel-app .psel-control-group { margin-bottom: 5px; }
#psel-app .psel-slider-header { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 8px; font-size: 0.95rem; }
#psel-app .psel-area-value { font-size: 1.3rem; color: var(--pice-primary); font-weight: 800; }

/* SLIDER WRAPPER & TOOLTIP */
#psel-app .psel-slider-container {
    position: relative;
    padding: 15px 0 5px 0; /* space for tooltip */
    z-index: 5;
}
#psel-app input[type="range"] {
    width: 100%; height: 8px; border-radius: 5px; background: #e9ecef !important; outline: none;
    -webkit-appearance: none; -moz-appearance: none; appearance: none;
    margin: 0; display: block;
}

/* WebKit - Thumb */
#psel-app input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: #fff; border: 5px solid var(--pice-primary); cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15); position: relative; z-index: 2;
}

/* Firefox - Thumb */
#psel-app input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff; border: 5px solid var(--pice-primary); cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* Tooltip Styles UPDATED */
#psel-app .psel-slider-tooltip {
    position: absolute;
    bottom: 35px; /* выше ползунка */
    transform: translateX(-50%);
    background: #fff; color: #333;
    padding: 15px; border-radius: 8px;
    font-size: 0.85rem; line-height: 1.4;
    text-align: left; /* Текст слева */
    width: 340px; /* Фиксированная ширина для контента */
    pointer-events: none;
    opacity: 0; transition: opacity 0.2s, left 0.1s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    border: 1px solid rgba(0,0,0,0.1);
    z-index: 100;
}
#psel-app .psel-slider-tooltip.visible { opacity: 1; }

/* Внутренние элементы тултипа */
#psel-app .psel-tt-row { margin-bottom: 4px; display: flex; justify-content: space-between; }
#psel-app .psel-tt-row strong { color: #000; }
#psel-app .psel-tt-title { font-weight: 800; margin-bottom: 8px; color: var(--pice-primary); font-size: 0.95rem; border-bottom: 1px solid #eee; padding-bottom: 5px; }
#psel-app .psel-tt-list { margin: 8px 0; padding-left: 0; list-style: none; font-size: 0.8rem; color: #555; }
#psel-app .psel-tt-list li { margin-bottom: 3px; padding-left: 10px; position: relative; }
#psel-app .psel-tt-list li::before { content: "•"; position: absolute; left: 0; color: var(--pice-primary); }
#psel-app .psel-tt-total { margin-top: 10px; padding-top: 8px; border-top: 1px solid #eee; font-weight: 700; color: #000; font-size: 0.9rem; }
#psel-app .psel-tt-accent { color: #dc3545; font-weight: 800; display: block; margin-top: 5px; font-size: 1rem; }

#psel-app .psel-slider-tooltip .tooltip-arrow {
    position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #fff;
    filter: drop-shadow(0 2px 1px rgba(0,0,0,0.05));
}


#psel-app .psel-input-currency { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; color: #999; pointer-events: none; }
#psel-app .psel-custom-header { text-align: center; margin-bottom: 5px; font-weight: 600; font-size: 0.95rem; }
#psel-app .psel-slider-labels { display: flex; justify-content: space-between; margin-top: 5px; font-size: 0.8rem; color: #888; }

/* COST STRUCTURE */
#psel-app .psel-divider { border: 0; border-top: 1px solid rgba(0,0,0,0.08); margin: 20px 0; }
#psel-app .psel-cost-structure { background: rgba(255,255,255,0.7); padding: 15px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.05); font-size: 0.9rem; }
#psel-app .psel-cost-row { display: flex; justify-content: space-between; margin-bottom: 6px; border-bottom: 1px dashed rgba(0,0,0,0.1); padding-bottom: 4px; }
#psel-app .psel-cost-row.total { border-top: 1px solid rgba(0,0,0,0.2); padding-top: 10px; border-bottom: none; margin-top: 10px; font-size: 1.05rem; font-weight: 700; }
#psel-app .col-right { text-align: right; display: flex; flex-direction: column; }
#psel-app .col-right small { font-size: 0.7rem; color: #666; }

/* NEW LIST STYLE (BULLETS) */
#psel-app .psel-cost-list {
    list-style: none; padding: 0; margin: 0;
}
#psel-app .psel-cost-list li {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 8px; font-size: 0.95rem; line-height: 1.4;
    position: relative; padding-left: 15px;
}
#psel-app .psel-cost-list li .bull {
    position: absolute; left: 0; top: 0; color: var(--pice-primary); font-weight: bold;
}
#psel-app .psel-cost-list li strong {
    white-space: nowrap; margin-left: 10px;
}

/* BUYBACK GRID */
#psel-app .psel-buyback-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 15px; }
#psel-app .psel-bb-card {
    border: 1px solid #ddd; padding: 10px 5px; text-align: center; border-radius: 8px; cursor: pointer; transition: 0.2s; background: #fff;
}
#psel-app .psel-bb-card:hover { border-color: #999; }
#psel-app .psel-bb-card.active { border-color: var(--pice-primary); background: #fff; box-shadow: 0 0 0 2px var(--pice-primary) inset; }
#psel-app .bb-year { font-weight: bold; color: #555; font-size: 0.85rem; margin-bottom: 2px; }
#psel-app .bb-label { font-size: 0.75rem; color: #999; margin-bottom: 2px; line-height: 1; }
#psel-app .bb-roi { color: var(--pice-primary); font-weight: 800; font-size: 1.1rem; }

/* DASHBOARD */
#psel-app .psel-dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
#psel-app .psel-dash-card {
    padding: 12px; border-radius: 8px; color: #fff; text-align: center; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center;
}
#psel-app .psel-dash-card.blue { background: linear-gradient(135deg, #0d6efd, #0a58ca); }
#psel-app .psel-dash-card.green { background: linear-gradient(135deg, #198754, #146c43); }
#psel-app .psel-dash-card.purple { background: linear-gradient(135deg, #6f42c1, #59359a); }
#psel-app .psel-dash-card.orange { background: linear-gradient(135deg, #fd7e14, #d35400); }
#psel-app .dash-bg-icon { position: absolute; right: -5px; bottom: -5px; width: 40px; height: 40px; opacity: 0.15; color: #fff; pointer-events: none; }
#psel-app .dash-value { font-size: 1.2rem; font-weight: 800; line-height: 1.1; margin-bottom: 2px; position: relative; z-index: 2; white-space: nowrap; }
#psel-app .dash-label { font-size: 0.75rem; opacity: 0.95; margin-bottom: 2px; position: relative; z-index: 2; }
#psel-app .dash-sub { font-size: 0.65rem; opacity: 0.8; position: relative; z-index: 2; }

/* COMPARISON & CHART */
#psel-app .psel-card { background: #fff; padding: 5px; border-radius: 10px; margin-bottom: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
#psel-app .psel-comp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; background: #fff3cd; padding: 12px; border-radius: 8px; text-align: center; margin-bottom: 15px; }
#psel-app .psel-comp-box span { font-size: 0.8rem; color: #555; }
#psel-app .psel-comp-box strong { font-size: 1.3rem; display: block; line-height: 1.1; margin-top: 3px; }
#psel-app .psel-comp-box.highlight { border-left: 1px dashed rgba(0,0,0,0.1); }
#psel-app .psel-chart-wrapper { position: relative; height: 200px; width: 100%; overflow: hidden; }

/* FOOTER */
#psel-app .psel-cta { background: var(--pice-primary); color: #fff; padding: 25px 20px; text-align: center; border-radius: 10px; margin-top: 20px; transition: background 0.3s; }
#psel-app .psel-cta h2 { color: #fff !important; font-size: 1.4rem; margin-bottom: 5px; }
#psel-app #cta-text { color: #fff; font-size: 1.2rem; font-weight: 800; text-shadow: 0 1px 3px rgba(0,0,0,0.2); margin-bottom: 15px; opacity: 1; }
#psel-app .psel-cta-buttons { display: flex; gap: 10px; justify-content: center; margin: 15px 0; }
#psel-app .psel-btn { padding: 10px 25px; border-radius: 6px; font-weight: 600; cursor: pointer; text-decoration: none; border: none; display: inline-block; font-size: 0.95rem; }
#psel-app .psel-btn-outline { border: 2px solid #fff; color: #fff; background: transparent; }
#psel-app .psel-btn-fill { background: #fff; color: var(--pice-primary); }
#psel-app .psel-btn-fill:hover { transform: translateY(-2px); box-shadow: 0 3px 10px rgba(0,0,0,0.2); }

/* RESPONSIVE (MOBILE) IMPROVEMENTS */
@media (max-width: 768px) {
    #psel-app {
        padding: 0px;
        margin: 5px auto;
        width: 100%;
    }

    #psel-app .psel-slider-tooltip {
        width: 260px; /* Чуть уже на мобилках */
        padding: 10px;
    }

    .psel-settings-wrapper, .psel-results-wrapper {
        padding: 20px 15px;
    }

    /* Stack Mode Switcher & Make buttons bigger */
    #psel-app .psel-mode-switcher { grid-template-columns: 1fr; gap: 12px; }
    #psel-app .psel-mode-btn { padding: 15px; }

    /* Info Grid Stack */
    #psel-app .psel-info-grid { grid-template-columns: 1fr; gap: 12px; }
    #psel-app .psel-info-val { font-size: 1.3rem; }

    /* Dashboard: Keep 2 cols but larger text */
    #psel-app .psel-dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    #psel-app .psel-dash-card { padding: 15px 5px; }
    #psel-app .dash-value { font-size: 1.25rem; }
    #psel-app .dash-label { font-size: 0.8rem; }

    /* Buyback Grid */
    #psel-app .psel-buyback-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    #psel-app .psel-bb-card { padding: 15px 5px; }

    /* Comparison Stack */
    #psel-app .psel-comp-grid { grid-template-columns: 1fr; gap: 15px; }
    #psel-app .psel-comp-box.highlight { border-left: none; border-top: 1px dashed rgba(0,0,0,0.1); padding-top: 15px; }

    /* Buttons Stack */
    #psel-app .psel-cta-buttons { flex-direction: column; gap: 15px; }
    #psel-app .psel-btn { width: 100%; padding: 15px; font-size: 1.1rem; }

    /* Slider Touch Target */
    #psel-app input[type="range"]::-webkit-slider-thumb {
        width: 28px; height: 28px;
    }

    /* Slider Header - уменьшаем текст на мобилках */
    #psel-app .psel-slider-header {
        font-size: 0.75rem;
        flex-wrap: wrap;
        gap: 5px;
    }
    #psel-app .psel-slider-header label {
        flex: 1 1 100%;
        margin-bottom: 5px;
    }
    #psel-app .psel-area-value {
        font-size: 1.1rem;
        white-space: nowrap;
    }

    /* Подпись под слайдером - уменьшаем на мобилках */
    #psel-app .psel-controls-body p {
        font-size: 11px !important;
        line-height: 1.3;
    }
}

/* MODAL */
.psel-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(33, 37, 41, 0.75); backdrop-filter: blur(4px);
    z-index: 2147483647; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity 0.3s ease;
}
.psel-modal-overlay.open { opacity: 1; visibility: visible; }

.psel-modal-container {
    background: #fff; width: 90%; max-width: 420px; padding: 35px 30px;
    border-radius: 16px; position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-top: 5px solid var(--pice-primary); transform: translateY(20px); transition: transform 0.3s ease;
}
.psel-modal-overlay.open .psel-modal-container { transform: translateY(0); }

.psel-modal-close {
    position: absolute; top: 15px; right: 15px;
    background: transparent;
    border: none;
    width: 32px; height: 32px;
    padding: 0;
    border-radius: 50%;
    font-size: 26px;
    line-height: 1;
    color: #495057; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease;
}
.psel-modal-close:hover { background: #e9ecef; color: #dc3545; transform: rotate(90deg); }

.psel-modal-content h3 { margin-top: 0; margin-bottom: 20px; font-size: 1.5rem; text-align: center; color: #212529; font-weight: 800; }
.psel-summary-box {
    background: #f8f9fa; border: 1px solid #e9ecef; border-left: 4px solid var(--pice-primary);
    padding: 15px; border-radius: 8px; margin-bottom: 25px; font-size: 0.95rem; color: #495057; line-height: 1.5;
}
.psel-summary-box strong { display: block; color: #212529; font-weight: 700; font-size: 1rem; margin-bottom: 5px; }

#psel-app .psel-form-group { margin-bottom: 20px; text-align: left; }
#psel-app .psel-form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #343a40; font-size: 0.9rem; }
#psel-app .psel-form-group input {
    width: 100%; padding: 12px 15px; border: 2px solid #e9ecef; border-radius: 8px; font-size: 1rem; transition: border-color 0.2s; background: #fff;
}
#psel-app .psel-form-group input:focus { border-color: var(--pice-primary); outline: none; }

#psel-app .psel-btn-block {
    width: 100%; display: block; padding: 14px; font-size: 1.1rem; font-weight: 700;
    margin-top: 15px; background: var(--pice-primary); color: #ffffff !important;
    border: none; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.15); cursor: pointer; transition: all 0.2s ease;
}
#psel-app .psel-btn-block:hover { box-shadow: 0 6px 15px rgba(0,0,0,0.25); transform: translateY(-2px); opacity: 0.95; color: #ffffff !important; }

#psel-app .psel-success-message { text-align: center; padding: 40px 0; }
#psel-app .psel-success-message h4 { font-size: 1.4rem; color: var(--pice-primary); margin-bottom: 10px; }

/* Number inputs with spinners */
#psel-app input[type="number"].psel-grid-additional {
    width: 80px;
    padding: 6px 8px;
    text-align: center;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    -webkit-appearance: auto;
    -moz-appearance: number-input;
    appearance: auto;
}
#psel-app input[type="number"].psel-grid-additional::-webkit-inner-spin-button,
#psel-app input[type="number"].psel-grid-additional::-webkit-outer-spin-button {
    -webkit-appearance: inner-spin-button;
    opacity: 1;
    height: auto;
    cursor: pointer;
    margin-left: 4px;
}
#psel-app input[type="number"].psel-grid-additional:hover,
#psel-app input[type="number"].psel-grid-additional:focus {
    border-color: var(--pice-primary);
    outline: none;
}

/* ACCORDION STYLES */
#psel-app .psel-accordion {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
}

#psel-app .psel-btn-details {
    padding: 12px 30px;
    background: white;
    border: 2px solid var(--pice-primary);
    color: var(--pice-primary);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

#psel-app .psel-btn-details:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    background: var(--pice-primary);
    color: white;
}

/* Chart header flex layout for bank toggle */
#psel-app .psel-chart-section h3 {
    display: flex;
    align-items: center;
    width: 100%;
}

#psel-app .psel-chart-section h3 label {
    margin-left: auto;
    font-size: 14px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

#psel-app .psel-chart-section h3 label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Responsive styles updates */
@media (max-width: 768px) {
    #psel-app .psel-chart-section h3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    #psel-app .psel-chart-section h3 label {
        margin-left: 0;
    }

    #psel-app .psel-btn-details {
        width: 100%;
        padding: 15px;
    }
}
