/* ═══════════════════════════════════════════════════════════════
   kalkulator4.css — extra styles for kalkulator4.html
   (kalkulator2.css is also linked and provides base chat UI)
   ═══════════════════════════════════════════════════════════════ */

/* ── Typology shares input grid ── */
.typology-shares-wrap {
    margin-bottom: 0.4rem;
}

.typology-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.38rem;
}

.typology-label-text {
    flex: 1;
    font-size: 0.88rem;
    color: #0e0e0e;
}

.typology-pct-input {
    width: 62px;
    padding: 0.32rem 0.45rem;
    border: 1.5px solid #c0cdd9;
    border-radius: 6px;
    font-size: 0.92rem;
    font-family: inherit;
    text-align: right;
    color: #0e0e0e;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}

.typology-pct-input:focus {
    border-color: #708AA7;
}

.typology-unit {
    font-size: 0.85rem;
    color: #666;
    min-width: 14px;
}

.typology-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.55rem;
    padding-top: 0.4rem;
    border-top: 1px solid #d8e2ec;
    font-size: 0.85rem;
    color: #555;
}

.typology-total-value {
    font-weight: 700;
    color: #708AA7;
    min-width: 34px;
    text-align: right;
}

.typology-total-value.typo-error {
    color: #c0392b;
}

/* ── Five-slider complexity group ── */
.complexity-group-5 {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.complexity-item-5 {
    border-bottom: 1px solid #e0e8f0;
    padding-bottom: 0.8rem;
}

.complexity-item-5:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.complexity-item-label-5 {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.complexity-item-label-5 a {
    color: #708AA7;
    text-decoration: none;
}

.complexity-item-label-5 a::after {
    content: '→';
    margin-left: 0.5rem;
}

.complexity-item-label-5 a:hover {
    color: #000;
}

.complexity-item-levels-5 {
    position: relative;
    font-size: 0.71rem;
    color: #888;
    height: 1.3em;
    margin-bottom: 1px;
}

.complexity-item-levels-5 span {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Centers over the 2nd, 5th, 8th, 11th allowed snap stops (1.05, 1.25, 1.45, 1.65)
   Formula: calc(pct% + (1 - pct/100) * 11px - pct/100 * 11px) simplified to calc(pct% + (11 - 22*pct/100)px) */
.complexity-item-levels-5 span:nth-child(1) { left: calc(7.14%  + 9.43px); }
.complexity-item-levels-5 span:nth-child(2) { left: calc(35.71% + 3.14px); }
.complexity-item-levels-5 span:nth-child(3) { left: calc(64.29% - 3.14px); }
.complexity-item-levels-5 span:nth-child(4) { left: calc(92.86% - 9.43px); }

.complexity-item-val-5 {
    text-align: right;
    font-size: 0.83rem;
    font-weight: 700;
    color: #708AA7;
    margin-top: 1px;
}

.k4-final-factor-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.9rem;
    padding-top: 0.75rem;
    border-top: 2px solid #ccd8e5;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0e0e0e;
}

.k4-final-factor-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: #708AA7;
    background: #eef2f7;
    border-radius: 20px;
    padding: 0.15rem 0.8rem;
}

/* ── Special scope checkboxes ── */
.k4-scope-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.k4-scope-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    -webkit-user-select: none;
    user-select: none;
    line-height: 1.4;
}

.k4-scope-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #708AA7;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Reusable slider extra labels ── */
.reusable-pct-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.69rem;
    color: #888;
    margin-top: 1px;
    margin-bottom: 2px;
}

/* ── Reference link below slider (generic) ── */
.k4-ref-link {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.82rem;
}

.k4-ref-link a {
    color: #708AA7;
    text-decoration: underline;
}

.k4-ref-link a:hover {
    color: #000;
}

/* ── Firm size chips (vertical list) ── */
.k4-firmsize-group {
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    margin-bottom: 0.8rem;
}

.k4-firmsize-chip {
    padding: 0.55rem 0.9rem;
    border: 1.5px solid #b0bfcc;
    border-radius: 8px;
    background: #fff;
    color: #0e0e0e;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.17s, background 0.17s, color 0.17s;
    -webkit-user-select: none;
    user-select: none;
    text-align: left;
}

.k4-firmsize-chip:hover:not(.chip-selected) {
    border-color: #708AA7;
}

.k4-firmsize-chip.chip-selected {
    background: #708AA7;
    border-color: #708AA7;
    color: #fff;
}

/* ── Hourly rates table in result area ── */
.k4-hourly-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.k4-hourly-table td {
    padding: 4px 8px;
    border-bottom: 1px solid #000;
    vertical-align: middle;
}

.k4-hourly-table td:last-child {
    text-align: right;
}

/* ── Print ── */
@media print {
    /* Show the ancestor chain for printView4.
       styles.css hides body > * and all slider-panel children except #printView / #printView_k1.
       These rules override that for the kalkulator4 print path. */

    /* Show container and slider-panel that contain printView4 */
    .container:has(#printView4),
    .slider-panel:has(#printView4) {
        display: block !important;
        position: static !important;
        visibility: visible !important;
        left: auto !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    /* Show printView4 itself.
       Selector specificity (2,1,0) matches styles.css hide rule; kalkulator4.css loads later so wins. */
    .slider-panel > *:not(#_none)#printView4 {
        display: block !important;
        position: static !important;
        visibility: visible !important;
        left: auto !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }
}
