.cal-container {
    margin: 0px 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.cal-header {
    padding: 28px 30px;
    background: #f7f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.cal-title {
    font-size: 20px;
    margin:0;
    font-weight: 700;
    line-height: 1.7;
}

.cal-description {
    margin:0;
    color: #687078;
    font-size: 14px;
    line-height: 1.8;
}

.cal-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 30px;
}

.cal-field {
    min-width: 0;
    width: 100% !important;
    margin-bottom: 0;
}

.cal-field-full {
    grid-column: 1 / -1;
}

.cal-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
}

.cal-unit {
    color: #7b858c;
    font-weight: 400;
}

.cal-input {
    width: 100%;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid #d9dee2;
    border-radius: 9px;
    background: #fff;
    color: #252a2d;
    font-size: 15px;
    outline: none;
    transition:
        border-color .2s ease,
        box-shadow .2s ease;
    box-sizing: border-box;
}

.cal-input:focus {
    border-color: #007378;
    box-shadow: 0 0 0 3px rgba(0, 115, 120, .10);
}

.cal-input::placeholder {
    color: #a1a8ad;
}

.cal-action {
    padding: 0 30px 30px;
}

.cal-button {
    width: 100%;
    min-height: 52px;
    padding: 12px 20px;
    border: 0;
    border-radius: 9px;
    background: #007378;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background .2s ease,
        transform .15s ease;
}

.cal-button:hover {
    background: #005e62;
}

.cal-button:active {
    transform: translateY(1px);
}

.cal-button:focus-visible {
    outline: 3px solid rgba(0, 115, 120, .20);
    outline-offset: 2px;
}

.cal-error {
    margin: 0 30px 30px;
    padding: 13px 15px;
    border: 1px solid #f1c4c4;
    border-radius: 9px;
    background: #fff6f6;
    color: #a52b2b;
    font-size: 14px;
    line-height: 1.8;
}
/*
 * Result Modal
 */
.cal-result-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.cal-result-modal[hidden] {
    display: none !important;
}

.cal-result-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 27, 29, .58);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.cal-result-dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-height: calc(100vh - 50px);
    overflow-y: auto;
    border: 1px solid #dce7e8;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 70px rgba(0, 0, 0, .18);
    animation: calResultModalIn .2s ease-out;
}

@keyframes calResultModalIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.cal-result-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 20px 22px;
    border-bottom: 1px solid #e1eaeb;
    background: #f8fbfb;
}

.cal-result-header strong {
    color: #202829;
    font-size: 17px;
    font-weight: 700;
}

.cal-result-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #edf2f2;
    color: #586263;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    transition:
        background .2s ease,
        color .2s ease;
}

.cal-result-container {
  margin-top: 30px;
  text-align: right;
  color: #008e7a;
  direction: rtl;
  line-height: 2;
  padding: 0 10px;
  width: 100%;
  float: right;
  font-size: 17px;
  height: 100vh;
  margin: auto;
  right: 0;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
}
.cal-result-container[hidden] {
    display: none !important;
}
.cal-result-close:hover {
    background: #e1e8e8;
    color: #202829;
}

.cal-result-close:focus-visible {
    outline: 3px solid rgba(0, 115, 120, .20);
    outline-offset: 2px;
}

.cal-result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cal-result-item {
    min-width: 0;
    padding: 22px;
    border-bottom: 1px solid #e1eaeb;
}

.cal-result-item:nth-child(odd) {
    border-left: 1px solid #e1eaeb;
}

.cal-result-item:nth-child(3),
.cal-result-item:nth-child(4) {
    border-bottom: 0;
}

.cal-result-main {
    background: rgba(0, 115, 120, .055);
}

.cal-result-label {
    display: block;
    margin-bottom: 8px;
    color: #667177;
    font-size: 13px;
    line-height: 1.7;
}

.cal-result-item strong {
    font-size: 25px;
    line-height: 1.4;
    font-weight: 800;
    color: #202829;
}

.cal-result-unit {
    margin-right: 5px;
    color: #687078;
    font-size: 13px;
}

.cal-result-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 25px;
    padding: 18px 22px;
    border-top: 1px solid #e1eaeb;
    color: #4e595e;
    font-size: 14px;
    line-height: 1.8;
}

.cal-result-summary strong {
    margin: 0 4px;
    color: #202829;
}

.cal-result-note {
    padding: 15px 22px;
    border-top: 1px solid #e1eaeb;
    color: #687078;
    font-size: 13px;
    line-height: 1.9;
}


/*
 * جلوگیری از اسکرول صفحه هنگام باز بودن مودال
 */
body.cal-modal-open {
    overflow: hidden;
}


/*
 * Mobile
 */
@media (max-width: 767px) {

    .cal-result-modal {
        padding: 15px;
    }

    .cal-result-dialog {
        max-height: calc(100vh - 30px);
        border-radius: 15px;
    }

    .cal-result-header {
        padding: 16px 18px;
    }

    .cal-result-grid {
        grid-template-columns: 1fr;
    }

    .cal-result-item,
    .cal-result-item:nth-child(odd),
    .cal-result-item:nth-child(3),
    .cal-result-item:nth-child(4) {
        border-left: 0;
        border-bottom: 1px solid #e1eaeb;
    }

    .cal-result-item:last-child {
        border-bottom: 0;
    }

    .cal-result-item {
        padding: 18px;
    }

    .cal-result-item strong {
        font-size: 23px;
    }

    .cal-result-summary {
        display: block;
        padding: 16px 18px;
    }

    .cal-result-summary > div + div {
        margin-top: 5px;
    }

    .cal-result-note {
        padding: 14px 18px;
    }

}

.cal-trapezoid-field,
.cal-square-field {
    display: none;
}

.chabok-calculator {color: #303536; line-height: 2; } .chabok-calculator p { margin: 0 0 18px; color: #3f3f3f; font-size: 14px; line-height: 2.1; } .chabok-calculator h2 { color: #202829; } /* Sections */ .chabok-calculator-section { padding: 0 0 40px; margin-bottom: 40px; border-bottom: 1px solid #edf0f0; } .chabok-calculator-section.chabok-calculator-last { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; } .chabok-calculator-section h2 { position: relative; margin: 0 0 18px; padding-right: 15px; font-size: 21px; font-weight: 700; } .chabok-calculator-section h2:before { content: ""; position: absolute; right: 0; top: 8px; width: 4px; height: 20px; border-radius: 5px; background: #a76a33; } /* Formula */ .chabok-calculator-formula { margin: 4px 0 22px; padding: 14px 20px; border: 1px solid #edf0f0; border-right: 4px solid #a76a33; border-radius: 12px; background: #f7f9f9; text-align: center; } .chabok-calculator-formula strong { color: #202829; font-size: 16px; font-weight: 700; line-height: 2; } /* Note */ .chabok-calculator-note { display: flex; align-items: flex-start; gap: 12px; padding: 15px 18px; margin-top: 22px; border-radius: 12px; background: #f7f9f9; } .chabok-calculator-note i { margin-top: 5px; color: #a76a33; font-size: 17px; } .chabok-calculator-note p { margin: 0; font-size: 13px; } /* List */ .chabok-calculator-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; } .chabok-calculator-list.chabok-calculator-list-single { grid-template-columns: 1fr; } .chabok-calculator-list div { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px; background: #f8f9f9; color: #586263; font-size: 13px; line-height: 1.9; } .chabok-calculator-list i { color: #a76a33; } /* Mobile */ @media (max-width: 575.98px) { .chabok-calculator-section { margin-bottom: 30px; padding-bottom: 30px; } .chabok-calculator-section h2 { font-size: 18px; } .chabok-calculator-formula { padding: 12px 14px; } .chabok-calculator-formula strong { font-size: 14px; } .chabok-calculator-list { grid-template-columns: 1fr; } }

@media (max-width: 767px) {

    .cal-container {
        margin: 0px 0;
        border-radius: 13px;
    }

    .cal-header {
        padding: 22px 18px;
    }

    .cal-title {
        font-size: 19px;
    }

    .cal-fields {
        grid-template-columns: 1fr;
        gap: 17px;
        padding: 20px 18px;
    }

    .cal-field-full {
        grid-column: auto;
    }

    .cal-action {
        padding: 0 18px 20px;
    }

    .cal-error {
        margin: 0 18px 20px;
    }
}