﻿.input-group-card {
    background: var(--bg);
    border: 1px solid var(--shadow-warm);
    border-radius: var(--radius);
    padding: 5px 16px;
    margin-bottom: 7px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

    .input-group-card:focus-within {
        background: #fafafa;
        border-color: #d1d1d1;
    }

.label-main {
    font-size: 13px;
    font-weight: 600;
    color: var(--warm);
    margin-bottom: 6px;
    display: block;
}

.unit-text {
    color: var(--muted);
    font-weight: 400;
    margin-left: 4px;
}

.group-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%; 
}

.input-field {
    flex: 1;
    border: none !important;
    outline: none !important;
    background: transparent !important;
    font-size: 18px;
    color: var(--text);
    padding: 4px 0;
    box-shadow: none !important;
}

.clear-btn {
    all: unset; 
    display: none; 
    cursor: pointer;
    color: var(--muted);
    font-size: 16px;
    padding: 4px;
    line-height: 1;
    flex-shrink: 0;
}
    .clear-btn:hover {
        color: var(--accent);
    }

.unit-select {
    flex-shrink: 0;
    width: auto !important; 
    align-self: flex-start; 
    appearance: auto !important;
    -webkit-appearance: menulist !important;
    border: 1px solid #ccc !important;
    border-radius: 6px;
    background-color: #f9f9f9;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    height: 32px;
    min-width: 70px;
    padding: 0 4px;
    outline: none !important;
    border: unset !important;
}

.unit-label {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--warm);
    font-weight: 600;
    padding-left: 10px;
    border-left: 1px solid var(--shadow-warm);
}

.solution-details {
    margin-top: 15px;
    border-radius: var(--radius);
    background: #fdfdfd;
    overflow: hidden;
    transition: all 0.3s ease;
}

.solution-summary {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--warm);
    cursor: pointer;
    list-style: none; 
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}
    .solution-summary::-webkit-details-marker {
        display: none; 
    }

    .solution-summary::after {
        content: "▼";
        font-size: 10px;
        transition: transform 0.3s;
        color: var(--muted);
    }

    .solution-summary:hover {
        background: #f7f7f7;
    }

.solution-details[open] {
  
}
    .solution-details[open] .solution-summary {
       
        border-bottom: 1px solid var(--shadow-warm);
    }

        .solution-details[open] .solution-summary::after {
            transform: rotate(180deg);          
        }

.solution-content {
    padding: 16px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: white;
    overflow-x: auto;
    overflow-y: hidden;
    width: -webkit-fill-available;
    width: -moz-available;
}

.button-combo-wrap {
    display: inline-flex;
    align-items: stretch; 
    background: var(--accent); 
    border-radius: 10px;
    overflow: hidden; 
    transition: transform 0.1s ease;
}

    .button-combo-wrap .asp-button {
        border-radius: 0; 
        padding-right: 15px;
    }

.unit-select-combo {
    appearance: none;
    -webkit-appearance: none;
    background-color: rgba(255, 255, 255, 0.15); 
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://w3.org' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 10px;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.3); 
    color: #fff;
    font-weight: 700;
    padding: 0 25px 0 10px;
    cursor: pointer;
    outline: none !important;
    font-size: 14px;
}

.button-combo-wrap:hover {
    filter: brightness(1.05); 
}
.unit-select-combo:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.unit-select-combo option {
    color: #000;
    background: #fff;
}
.checkbox-row {
    display: block;
    width: 100%;
    margin: 15px 0; 
}
.checkbox-container {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: var(--warm);
    font-size: 14px;
    font-weight: 600;
    gap: 12px; 
    user-select: none;
}

    .checkbox-container input[type="checkbox"] {
        appearance: none;
        -webkit-appearance: none;
        width: 22px; 
        height: 22px;
        border: 2px solid var(--shadow-warm);
        border-radius: 7px; 
        background: transparent;
        cursor: pointer;
        position: relative;
        margin: 0;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.25s ease;
    }

    .checkbox-container:hover input[type="checkbox"] {
        border-color: var(--muted);
        background-color: #fafafa; 
    }

    .checkbox-container input[type="checkbox"]:checked {
        border-color: var(--warm);
    }

        .checkbox-container input[type="checkbox"]:checked::after {
            content: "";
            width: 5px; 
            height: 10px; 
            border: solid var(--warm);
            border-width: 0 2px 2px 0; 
            border-radius: 1px; 
            transform: rotate(45deg);           
            margin-top: -2px;
            margin-left: 0px;
        }

.result-main-title {
    margin: 0 0 8px;
    font-weight: 800;
    color: var(--warm);
    font-size: 18px;
}

.steps-sub-title {
    padding: 0;
    margin: 0;
    margin-bottom: 2px;
    font-size: 18px;
    font-weight: 700;
}

.solution-data {
    padding: 12px 16px;
    margin-top: 15px;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    overflow-x: auto;
    overflow-y: hidden;
    width: -webkit-fill-available;
    width: -moz-available;
}

.instructions-picture {
    border: 1px solid var(--shadow-warm);
    border-radius: var(--radius);
    padding: 5px 16px;
    margin-bottom: 7px;
}

h1 {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 10px;
    color: #565656;
    line-height: 30px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 25px;
        font-weight: 800;
        margin: 0 0 10px;
        color: #565656;
        line-height: 27px;
    }

}
    
    article {
        color: #63564f;
    }

    .rules-summary {
        text-decoration: underline;
    }

    .instructions-picture mjx-container[jax="CHTML"] {
        line-height: 24px !important;
    }

    article mjx-container[jax="CHTML"] {
        line-height: 24px !important;
    }


    .instructions-picture span {
        display: block;
        color: var(--muted);
    }

    .instructions-picture img, .instructions-latex {
        display: block;
        height: 74px;
        clear: both;
        float: inline-start;
        border-style: dotted;
        border-top-right-radius: 5px;
        border-width: 1px;
        border-color: #aeaeaecf;
        border-left: unset;
        border-bottom: unset;
        padding-right: 3px;
        padding-top: 4px;
        margin-right: 12px;
        margin-top: 4px;
        font-size: 22px;
        color: var(--footer-bg);
    }

    .instructions-latex {
        height: auto !important;
        border-style: dotted;
        border-width: 1px;
        padding: 8px;
        border-color: #aeaeaecf;
    }

    .calc-examples, .calc-equations-examples {        
        display: flex;
        flex-wrap: wrap;
        font-size: 90%;
        color: var(--footer-bg) #080808cf;
        padding: 5px;
        column-gap: 30px;
    }

        .calc-examples div,
        .calc-equations-examples div {
            cursor: pointer;
            border-bottom-style: dotted;
            border-block-width: 1px;
            width: fit-content;
            margin-bottom: 10px;
            padding-bottom: 4px;
            border-color: lightgray;
        }

        .calc-examples mjx-container,
        .calc-examples mjx-container *,
        .calc-equations-examples mjx-container,
        .calc-equations-examples mjx-container * {
            user-select: none !important;
            -webkit-user-select: none !important;
            -moz-user-select: none !important;
            -ms-user-select: none !important;
            pointer-events: none !important;
        }

    .examples-gallery {
        font-size: 14px;
        color: var(--muted);
        margin-bottom: 15px;
        margin-left: 10px;
    }

    .calc-examples-sum {
        cursor: pointer;
        border-style: dotted;
        border-block-width: 1px;
        width: fit-content;
        margin-bottom: 10px;
        border-color: lightgray;
        display: inline-block;
        border-width: 1px;
        padding: 10px;
        border-radius: 5px;
    }

    .copy-math mjx-container,
    .copy-math .katex {
        pointer-events: none;
        user-select: none;
    }

    .copy-math {
        cursor: pointer;
        color: #4c4040;
    }

    .copy-toast {
        position: fixed;
        bottom: 20px;
        right: 20px;
        max-width: 300px;
        background: var(--accent);
        color: white;
        padding: 10px 18px;
        border-radius: 8px;
        font-size: 15px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.25);
        opacity: 1;
        transition: opacity 0.3s, transform 0.3s;
        z-index: 9999;
    }

        .copy-toast.hide {
            opacity: 0;
            transform: translateY(10px);
        }


    mjx-container[jax="CHTML"] {
        line-height: 30px !important;
    }

    mjx-math {
        line-height: 4px !important;
    }

    .page-padding {        
    }

    .calc-section {
        max-width: var(--max-width);
        margin: 24px auto;
    }

    .calc-grid {
        border-radius: 10px;
        box-shadow: 0 4px 14px var(--shadow-warm);
        padding: 20px;
    }

    .calc-controls {
        
    }

    .calc-column {
        
    }
    
    .calc-left {
       
    }

    .calc-result {
       
    }

    @media (max-width: 980px) {
        .calc-grid {
            grid-template-columns: 1fr;
            height: auto;
        }

        .calc-controls {
            height: auto;
            max-height: fit-content;
            min-height: auto;
        }

        .calc-left {
            height: auto;
            width: auto;
        }

        .calc-result {
            height: auto;
        }

        .calc-column {
            max-height: unset;
            overflow-x: unset;
        }
    }

    .calc-panel {
        background: #fff;
        border-radius: 12px;        
    }

        .calc-panel hr {
            display: block;
            width: 100%;
            margin-top: 15px;
            margin-bottom: 15px;
            border-style: solid;
            border-width: 1px;
            height: 1px;
            border-bottom: none;
            border-top: 1px dashed rgba(0, 0, 0, 0.1);
        }


    .calc-instructions .asp-label {
        display: block;
        color: var(--muted);
    }

    .calc-controls .field-label,
    .calc-controls .field-label-top {
        display: block;
        margin-bottom: 4px;
        font-weight: 700;
        color: var(--warm);
        margin-left: 4px;
    }

    .calc-controls .field-label-top {
        margin-top: 0px;
    }

    .asp-input, .asp-select {
        width: 100%;
        padding: 10px 12px;
        border-radius: 10px;
        border: 1px solid var(--shadow-warm);
        font-size: 14px;
        outline: none;
    }

    .options-group, .options-group-top {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .options-group-line {
        display: flex;
        gap: 6px;
        align-items: center;
    }

    .options-group-top {
        margin-top: 0px;
    }

    .option, .option-radio {
        display: flex;
        gap: 8px;
        color: var(--muted);
        font-size: 14px;
    }

    .calc-actions {
        margin-top: 20px;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .asp-button {
        background: var(--accent);
        color: #fff;
        border: 0;
        padding: 8px 11px;
        border-radius: 10px;
        cursor: pointer;
        font-weight: 700;
        margin-left: 5px;
    }

    .asp-button-secondary {
        background: transparent;
        border: 1px solid rgba(0,0,0,0.06);
        padding: 10px 12px;
        border-radius: 10px;
        cursor: pointer;
    }

    .calc-result .result-title {
        margin: 0 0 8px;
        font-weight: 800;
        color: var(--warm);
        font-size: 18px;
    }

    .result-output {
        font-size: 18px;
        font-weight: 800;
        color: #111;
        margin-bottom: 10px;
    }

    .steps {
        margin-top: 10px;
        border-top: 1px dashed rgba(0,0,0,0.1);
        padding-top: 8px;
        color: #4c4040;
        line-height: 1.5;
    }

        .steps h3 {
            padding: 0;
            margin: 0;
            margin-bottom: 2px;
            font-size: 18px;
        }

    .input-clear-wrapper {
        position: relative;
        display: flex;
        align-items: center;
    }

        .input-clear-wrapper .asp-input {
            padding-right: 36px;
            font-size: 14px;
            color: #413124;
        }

    .clear-input {
        position: absolute;
        right: 4px; 
        top: 50%;
        transform: translateY(-50%);
        border-left: 1px solid rgba(0,0,0,0.12); 
        background: transparent;
        border: none;
        width: 28px;
        height: 28px;
        font-size: 18px; 
        line-height: 1;
        cursor: pointer;
        color: var(--muted);
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

        .clear-input:hover {
            color: var(--muted);
            background: transparent;
        }

    input[type="radio"] {
        accent-color: var(--muted);
    }

    .calc-error {
        margin-top: 11px;
        font-size: 14px;
        line-height: 17px;
        padding: 8px;
        border-top-style: outset;
        border-width: 2px;
        padding-top: 2px;
        color: var(--accent);
    }

    .calc-description {
        color: #63564f;
    }

    .calc-theory, .calc-description {
        max-width: var(--max-width);
        margin: 0px auto;
        padding: 0 20px;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 4px 14px var(--shadow-warm);
        border: 1px solid rgba(0, 0, 0, 0.03);
    }

        .calc-theory h2, .calc-description h2 {
            font-size: 20px;
            font-weight: 800;
            color: var(--warm);
            margin-bottom: 16px;
        }

        .calc-theory h3, .calc-description h3 {
            font-size: 17px;
            font-weight: 800;
            color: var(--warm);
            margin-bottom: 16px;
        }

    .theory-definitions {
        border-left: 4px dotted var(--accent);
        padding-left: 12px;
        margin: 0 0 16px 0;
    }

    .about-calc-definitions {
        border-left: 4px dotted var(--accent);
        padding-left: 12px;
        margin: 0 0 16px 0;
    }

        .theory-definitions dt, .about-calc-definitions dt {
            font-weight: 700;
            color: var(--warm);
        }

        .theory-definitions dd, .about-calc-definitions dd {
            margin: 4px 0 0 0;
            color: var(--muted);
        }
    .theory-content {
        background: #f8f8f8;
        padding: 14px 16px;
        border-radius: 12px;
        margin-bottom: 16px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
        overflow-x: auto;
    }

    .about-calc-content {
        margin-bottom: 16px;
    }
    .theory-examples {
        background: #fff;
        margin-bottom: 16px;
        padding-top: 5px;
    }

        .theory-examples summary {
            font-weight: 700;
            cursor: pointer;
            color: var(--warm);
        }

        .theory-examples ul {
            margin: 8px 0 0 16px;
            padding: 0;
        }

        .theory-examples li {
            margin-bottom: 6px;
        }

    .theory-related {
        background: #f8f8f8;
        padding: 16px 18px;
        border-radius: 12px;
        box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    }

        .theory-related h3 {
            font-size: 16px;
            font-weight: 700;
            color: var(--warm);
            margin-bottom: 12px;
        }

    .related-list {
        list-style: none;
        padding: 0;
        margin: 0;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

        .related-list li a {
            display: block;
            padding: 8px 12px;
            border-radius: 8px;
            background: #fff;
            color: var(--warm);
            text-decoration: none;          
            transition: all 0.2s ease;
        }
          
            .related-list li a:hover {
                background: #b9b9b9c9;
                color: white;
            }

    @media (max-width: 768px) {
        .related-list {
            grid-template-columns: 1fr;
        }
    }
