﻿/* ==========================================================
   CALCINO KHOMS RULES V1
   ========================================================== */

.khoms-rule-card{
    animation:khomsRuleShow .18s ease;
}

@keyframes khomsRuleShow{
    from{
        opacity:0;
        transform:translateY(5px);
    }
    to{
        opacity:1;
        transform:none;
    }
}

.khoms-rule-hidden{
    display:none !important;
}


/* ==========================================================
   WEIGHT UNIT - GRAM / SOUT
   ========================================================== */

.weight-unit-selector{
    display:inline-grid;
    grid-template-columns:1fr 1fr;

    gap:3px;

    margin-bottom:11px;
    padding:3px;

    border:1px solid var(--border);
    border-radius:11px;

    background:#f7f9fa;
}

.weight-unit-selector button{
    min-width:64px;

    padding:7px 11px;

    border:0;
    border-radius:8px;

    background:transparent;
    color:var(--muted);

    cursor:pointer;

    font-size:10.5px;
    font-weight:700;

    transition:.16s ease;
}

.weight-unit-selector button.active{
    background:#fff;
    color:#73540f;

    box-shadow:
        0 2px 8px
        rgba(30,40,50,.08);
}

.weight-conversion{
    min-height:20px;

    margin-top:6px;

    color:var(--muted);

    font-size:10px;
    font-weight:500;
}

.weight-conversion strong{
    color:var(--gold);
}


/* ==========================================================
   CONDITIONAL HELP
   ========================================================== */

.rule-mini-note{
    margin-top:10px;

    padding:10px 12px;

    border-radius:10px;

    background:#f7f9fa;

    color:var(--muted);

    font-size:10.5px;
    line-height:1.9;
}

.rule-mini-note b{
    color:var(--text);
}


/* ==========================================================
   RESULT STATUS
   ========================================================== */

.khoms-result-status{
    width:max-content;
    max-width:100%;

    margin:
        9px auto
        3px;

    padding:6px 11px;

    border-radius:999px;

    font-size:9.5px;
    font-weight:800;

    text-align:center;
}

.khoms-result-status.definite{
    color:#087f5b;
    background:rgba(8,127,91,.09);
    border:1px solid rgba(8,127,91,.18);
}

.khoms-result-status.precaution{
    color:#9a6810;
    background:rgba(197,144,35,.10);
    border:1px solid rgba(197,144,35,.22);
}

.khoms-result-status.review{
    color:#4e6b82;
    background:rgba(70,109,139,.10);
    border:1px solid rgba(70,109,139,.20);
}

.khoms-result-status.sulh{
    color:#985a2e;
    background:rgba(162,95,46,.10);
    border:1px solid rgba(162,95,46,.20);
}

.khoms-result-status.professional{
    color:#7d5ca8;
    background:rgba(125,92,168,.10);
    border:1px solid rgba(125,92,168,.20);
}


/* ==========================================================
   DARK MODE
   ========================================================== */

html[data-theme="dark"] .weight-unit-selector{
    background:#111920;
    border-color:#2d3944;
}

html[data-theme="dark"] .weight-unit-selector button.active{
    background:#2f2819;
    color:#efc567;

    box-shadow:none;
}

html[data-theme="dark"] .rule-mini-note{
    background:#111920;
}

html[data-theme="dark"] .khoms-result-status.definite{
    color:#59d7ad;
}

html[data-theme="dark"] .khoms-result-status.precaution{
    color:#e5bd63;
}

html[data-theme="dark"] .khoms-result-status.review{
    color:#9bc7e5;
}

html[data-theme="dark"] .khoms-result-status.sulh{
    color:#e1a47c;
}

html[data-theme="dark"] .khoms-result-status.professional{
    color:#c2a2e8;
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media(max-width:650px){

    .weight-unit-selector{
        width:100%;
    }

    .weight-unit-selector button{
        min-height:38px;
    }

    .khoms-result-status{
        font-size:9px;
    }
}


/* KHOMS-AMOUNT-WORDS-CSS-START */

.khoms-amount-words{

    max-width:720px;

    margin:
        4px auto
        11px;

    padding:
        0 14px;

    text-align:center;

    color:#d8ad53;

    font-size:14px;
    font-weight:750;

    line-height:1.9;

    opacity:.96;
}


html[data-theme="dark"]
.khoms-amount-words{

    color:#e3ba61;
}


@media(max-width:650px){

    .khoms-amount-words{

        margin-top:3px;

        padding:
            0 8px;

        font-size:12px;

        line-height:1.8;
    }
}

/* KHOMS-AMOUNT-WORDS-CSS-END */


/* CALCINO-FIQH-STATUS-CSS-START */

.calcino-fiqh-status{

    margin:
        16px auto
        10px;

    padding:
        17px 18px;

    border-radius:
        14px;

    text-align:center;

    line-height:
        1.9;
}


.calcino-fiqh-status-title{

    font-size:
        15px;

    font-weight:
        900;
}


.calcino-fiqh-status-detail{

    margin-top:
        5px;

    font-size:
        10px;

    font-weight:
        500;

    opacity:
        .88;
}


/* normal */

.calcino-fiqh-status.normal{

    border:
        1px solid
        rgba(47,191,137,.25);

    background:
        rgba(47,191,137,.055);

    color:
        #41d39e;
}


/* important warning */

.calcino-fiqh-status.warning{

    border:
        1px solid
        rgba(230,174,51,.50);

    background:
        rgba(230,174,51,.10);

    color:
        #f0bf50;
}


.calcino-fiqh-status.warning
.calcino-fiqh-status-title{

    font-size:
        17px;
}


/* insufficient data */

.calcino-fiqh-status.unknown{

    border:
        1px solid
        rgba(230,174,51,.35);

    background:
        rgba(230,174,51,.065);

    color:
        #e4b44c;
}


@media(max-width:650px){

    .calcino-fiqh-status{

        padding:
            14px 12px;
    }


    .calcino-fiqh-status-title{

        font-size:
            13px;
    }


    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{

        font-size:
            15px;
    }
}

/* CALCINO-FIQH-STATUS-CSS-END */


/* CALCINO-SALE-FIQH-CSS-START */

.calcino-fiqh-status{

    margin:
        17px auto
        10px;

    padding:
        18px 20px;

    border-radius:
        15px;

    text-align:right;

    line-height:
        2;
}


.calcino-fiqh-status-title{

    font-size:
        14px;

    font-weight:
        900;

    color:
        #f4f6f8;
}


.calcino-fiqh-status-detail{

    margin-top:
        5px;

    font-size:
        11px;

    font-weight:
        600;

    color:
        #aebbc5;
}


.calcino-fiqh-status.warning{

    border:
        1px solid
        rgba(226,174,55,.42);

    background:
        rgba(226,174,55,.08);
}


.calcino-fiqh-status.warning
.calcino-fiqh-status-title{

    color:
        #f1c04f;

    font-size:
        16px;
}


.calcino-fiqh-status.unknown{

    border:
        1px solid
        rgba(226,174,55,.25);

    background:
        rgba(226,174,55,.045);
}


/* Sale flow */

.calcino-sale-question{

    margin:
        16px 0;

    padding:
        17px;

    border:
        1px solid
        rgba(210,168,69,.25);

    border-radius:
        15px;

    background:
        rgba(255,255,255,.018);
}


.calcino-sale-title{

    margin-bottom:
        12px;

    font-size:
        13px;

    font-weight:
        900;
}


.calcino-sale-options{

    display:grid;

    grid-template-columns:
        repeat(3,minmax(0,1fr));

    gap:
        8px;
}


.calcino-sale-options label{

    cursor:pointer;
}


.calcino-sale-options input{

    position:absolute;

    opacity:0;
}


.calcino-sale-options span{

    display:flex;

    min-height:
        66px;

    padding:
        10px;

    border:
        1px solid
        var(--border);

    border-radius:
        12px;

    flex-direction:
        column;

    justify-content:
        center;

    text-align:center;

    font-size:
        11px;

    font-weight:
        800;
}


.calcino-sale-options small{

    margin-top:
        4px;

    color:
        var(--muted);

    font-size:
        8.5px;

    font-weight:
        500;
}


.calcino-sale-options
input:checked + span{

    border-color:
        #c9942c;

    background:
        rgba(201,148,44,.12);

    color:
        #e8b84f;
}


.calcino-sale-income{

    margin-top:
        12px;

    padding:
        12px;

    border-radius:
        11px;

    background:
        rgba(255,255,255,.025);

    font-size:
        10px;

    line-height:
        1.8;
}


.calcino-sale-income.hidden{
    display:none;
}


.calcino-sale-income-options{

    display:flex;

    gap:
        18px;

    margin-top:
        8px;
}


@media(max-width:650px){

    .calcino-sale-options{

        grid-template-columns:
            1fr;
    }


    .calcino-fiqh-status-title{

        font-size:
            13px;
    }


    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{

        font-size:
            14px;
    }
}

/* CALCINO-SALE-FIQH-CSS-END */


/* CALCINO-PERMANENT-FIQH-CSS-START */

#calcinoPermanentFiqh{

    margin:
        20px 0
        4px;

    padding:
        19px 20px;

    border:
        1px solid
        rgba(202,153,48,.25);

    border-radius:
        15px;

    background:
        rgba(8,22,32,.72);

    text-align:
        right;

    direction:
        rtl;
}


.calcino-fiqh-heading{

    margin-bottom:
        9px;

    color:
        #d8a83f;

    font-size:
        11px;

    font-weight:
        800;
}


.calcino-fiqh-main{

    color:
        #f4f7f9;

    font-size:
        14px;

    font-weight:
        900;

    line-height:
        2;
}


.calcino-fiqh-detail{

    margin-top:
        6px;

    color:
        #bdc8cf;

    font-size:
        11px;

    font-weight:
        550;

    line-height:
        2;
}


.calcino-fiqh-source{

    margin-top:
        9px;

    color:
        #8e9ca6;

    font-size:
        9px;

    line-height:
        1.8;
}


@media(max-width:650px){

    #calcinoPermanentFiqh{

        padding:
            15px 14px;
    }


    .calcino-fiqh-main{

        font-size:
            12.5px;
    }


    .calcino-fiqh-detail{

        font-size:
            10px;
    }
}

/* CALCINO-PERMANENT-FIQH-CSS-END */


/* CALCINO-EMPTY-FORMULA-FIX-START */

/*
  Old arithmetic explanation container may remain
  after its "A ÷ 5 = B" text was intentionally removed.
  Empty boxes must not occupy UI space.
*/

#explanation :empty,
.result :is(
    .formula,
    .formula-box,
    .calculation-formula,
    .calculation-detail,
    .calc-formula,
    .calc-detail
):empty{
    display:none !important;
    min-height:0 !important;
    height:0 !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
}


/*
  Fallback for the old empty formula row.
*/

#explanation > div:empty{
    display:none !important;
}


/*
  Never affect the permanent Fiqh explanation.
*/

#calcinoFiqhStatus,
#calcinoFiqhStatus *{
    display:revert;
}

/* CALCINO-EMPTY-FORMULA-FIX-END */


/* CALCINO-KHOMS-RESULT-TYPOGRAPHY-START */

/* ==========================================================
   KHOMS MAIN RESULT
   ========================================================== */

#result .result-caption,
#result .result-label{
    font-size:12px !important;
    line-height:1.9 !important;
}

#khomsAmount{
    font-size:42px !important;
    line-height:1.35 !important;
    font-weight:900 !important;
}

.khoms-amount-words{
    font-size:15px !important;
    line-height:2 !important;
    font-weight:800 !important;
}

#result .khoms-unit,
#result .result-unit{
    font-size:12px !important;
}


/* ==========================================================
   RESULT SUMMARY CARDS
   ========================================================== */

#result .result-grid{
    gap:10px !important;
}

#result .result-item{
    padding:14px 11px !important;
}

#result .result-item small{
    font-size:10.5px !important;
    line-height:1.8 !important;
}

#result .result-item strong{
    font-size:13px !important;
    line-height:1.8 !important;
}


/* ==========================================================
   FIQH EXPLANATION
   ========================================================== */

.calcino-fiqh-status{
    padding:20px 22px !important;
    line-height:2.15 !important;
}

.calcino-fiqh-status-title{
    font-size:16px !important;
    line-height:2 !important;
    font-weight:900 !important;
}

.calcino-fiqh-status-detail{
    margin-top:8px !important;
    font-size:12px !important;
    line-height:2.1 !important;
    font-weight:600 !important;
}

.calcino-fiqh-status.warning
.calcino-fiqh-status-title{
    font-size:18px !important;
}


/* ==========================================================
   ECONOMIC / CAUTION NOTES
   ========================================================== */

.economic-head{
    font-size:13px !important;
}

.economic-period{
    font-size:11px !important;
}

.economic-grid span{
    font-size:10px !important;
}

.economic-grid strong{
    font-size:12.5px !important;
}

.economic-note,
.economic-message,
.khoms-fiqh-note{
    font-size:10.5px !important;
    line-height:2 !important;
}


/* ==========================================================
   TABLET
   ========================================================== */

@media(max-width:820px){

    #khomsAmount{
        font-size:38px !important;
    }

    .khoms-amount-words{
        font-size:14px !important;
    }

    .calcino-fiqh-status-title{
        font-size:15px !important;
    }

    .calcino-fiqh-status-detail{
        font-size:11.5px !important;
    }
}


/* ==========================================================
   MOBILE
   ========================================================== */

@media(max-width:650px){

    #result{
        padding:18px 14px !important;
    }

    #khomsAmount{
        font-size:34px !important;
        line-height:1.35 !important;
    }

    .khoms-amount-words{
        font-size:13px !important;
        line-height:1.95 !important;
        padding:0 4px !important;
    }

    #result .result-caption,
    #result .result-label{
        font-size:11px !important;
    }

    #result .result-grid{
        grid-template-columns:1fr !important;
        gap:8px !important;
    }

    #result .result-item{
        padding:12px !important;
    }

    #result .result-item small{
        font-size:10px !important;
    }

    #result .result-item strong{
        font-size:12.5px !important;
    }

    .calcino-fiqh-status{
        padding:16px 14px !important;
        text-align:right !important;
    }

    .calcino-fiqh-status-title{
        font-size:14px !important;
        line-height:2.05 !important;
    }

    .calcino-fiqh-status-detail{
        margin-top:6px !important;
        font-size:11px !important;
        line-height:2.05 !important;
    }

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{
        font-size:15.5px !important;
    }

    .economic-analysis{
        padding:13px !important;
    }

    .economic-head{
        font-size:11.5px !important;
    }

    .economic-period{
        font-size:10px !important;
    }

    .economic-grid span{
        font-size:9.5px !important;
    }

    .economic-grid strong{
        font-size:11.5px !important;
    }

    .economic-note,
    .economic-message,
    .khoms-fiqh-note{
        font-size:9.8px !important;
        line-height:2 !important;
    }
}


/* ==========================================================
   SMALL MOBILE
   ========================================================== */

@media(max-width:390px){

    #khomsAmount{
        font-size:31px !important;
    }

    .khoms-amount-words{
        font-size:12px !important;
    }

    .calcino-fiqh-status-title{
        font-size:13.5px !important;
    }

    .calcino-fiqh-status-detail{
        font-size:10.5px !important;
    }
}

/* CALCINO-KHOMS-RESULT-TYPOGRAPHY-END */


/* CALCINO-SETTLEMENT-WARNING-TYPE-START */

/*
  Important Fiqh warnings:
  intentionally more readable, but not oversized.
*/

.calcino-fiqh-status.warning{
    padding:
        21px 22px !important;
}

.calcino-fiqh-status.warning
.calcino-fiqh-status-title{

    font-size:
        18px !important;

    line-height:
        2.05 !important;

    font-weight:
        900 !important;

    letter-spacing:
        0 !important;
}

.calcino-fiqh-status.warning
.calcino-fiqh-status-detail{

    margin-top:
        8px !important;

    font-size:
        12.5px !important;

    line-height:
        2.1 !important;

    font-weight:
        600 !important;
}


/* Tablet */

@media(max-width:820px){

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{

        font-size:
            17px !important;
    }

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-detail{

        font-size:
            12px !important;
    }
}


/* Mobile */

@media(max-width:650px){

    .calcino-fiqh-status.warning{

        padding:
            17px 15px !important;
    }

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{

        font-size:
            16px !important;

        line-height:
            2 !important;
    }

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-detail{

        font-size:
            11.3px !important;

        line-height:
            2 !important;
    }
}


/* Small mobile */

@media(max-width:390px){

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{

        font-size:
            15px !important;
    }
}

/* CALCINO-SETTLEMENT-WARNING-TYPE-END */


/* CALCINO-FINAL-FIQH-TYPE-START */

/* ==========================================================
   FINAL FIQH TYPOGRAPHY
   This block intentionally overrides previous rules.
   ========================================================== */

.calcino-fiqh-status{
    padding:21px 22px !important;
    line-height:2.15 !important;
}

.calcino-fiqh-status-title{
    font-size:17px !important;
    line-height:2.05 !important;
    font-weight:900 !important;
}

.calcino-fiqh-status-detail{
    margin-top:8px !important;
    font-size:13px !important;
    line-height:2.1 !important;
    font-weight:600 !important;
}


/* Important warnings */

.calcino-fiqh-status.warning
.calcino-fiqh-status-title{
    font-size:19px !important;
    line-height:2 !important;
}

.calcino-fiqh-status.warning
.calcino-fiqh-status-detail{
    font-size:13.5px !important;
}


/* Tablet */

@media(max-width:820px){

    .calcino-fiqh-status-title{
        font-size:16px !important;
    }

    .calcino-fiqh-status-detail{
        font-size:12.5px !important;
    }

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{
        font-size:18px !important;
    }
}


/* Mobile */

@media(max-width:650px){

    .calcino-fiqh-status{
        padding:17px 15px !important;
    }

    .calcino-fiqh-status-title{
        font-size:15.5px !important;
        line-height:2 !important;
    }

    .calcino-fiqh-status-detail{
        font-size:12.5px !important;
        line-height:2.05 !important;
    }

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{
        font-size:17px !important;
    }

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-detail{
        font-size:12.5px !important;
    }
}


/* Small mobile */

@media(max-width:390px){

    .calcino-fiqh-status-title{
        font-size:15px !important;
    }

    .calcino-fiqh-status-detail{
        font-size:12px !important;
    }

    .calcino-fiqh-status.warning
    .calcino-fiqh-status-title{
        font-size:16.5px !important;
    }
}

/* CALCINO-FINAL-FIQH-TYPE-END */


/* CALCINO-KHOMS-MOBILE-FONT-BOOST-START */

@media (max-width: 768px) {

  /* سه باکسِ مبلغ خرید / ارزش فعلی / مبنای محاسبه */
  .khoms-result-grid .result-box .label,
  .khoms-summary-grid .summary-box .label,
  .result-grid .result-box .label,
  .summary-grid .summary-box .label,
  .result-cards .card .label,
  .result-card .label,
  .mini-result-card .label {
      font-size: 1rem !important;
      line-height: 1.9 !important;
  }

  .khoms-result-grid .result-box .value,
  .khoms-summary-grid .summary-box .value,
  .result-grid .result-box .value,
  .summary-grid .summary-box .value,
  .result-cards .card .value,
  .result-card .value,
  .mini-result-card .value {
      font-size: 1.18rem !important;
      line-height: 1.9 !important;
      font-weight: 800 !important;
  }

  /* توضیح خاکستریِ زیر نتیجه */
  .khoms-estimate-note,
  .khoms-estimate-note p,
  .khoms-warning-note,
  .khoms-warning-note p,
  .khoms-inline-note,
  .khoms-inline-note p,
  .khoms-disclaimer,
  .khoms-disclaimer p,
  .khoms-nearest-note,
  .khoms-nearest-note p,
  .result-disclaimer,
  .result-disclaimer p,
  .result-note,
  .result-note p,
  .assumption-note,
  .assumption-note p {
      font-size: 1.04rem !important;
      line-height: 2.05 !important;
  }

  /* باکس تحلیل کوتاهِ وسط */
  .khoms-short-analysis,
  .khoms-short-analysis p,
  .khoms-analysis-box,
  .khoms-analysis-box p,
  .khoms-logic-box,
  .khoms-logic-box p,
  .assumption-box,
  .assumption-box p {
      font-size: 1.08rem !important;
      line-height: 2.05 !important;
  }

  /* عنوان دلیل فقهی */
  .khoms-fiqh-title,
  .fiqh-title,
  .fiqh-reason-title,
  .reason-title,
  .khoms-fiqh-box .title,
  .fiqh-box .title {
      font-size: 1.22rem !important;
      line-height: 1.9 !important;
      font-weight: 900 !important;
  }

  /* متن دلیل فقهی */
  .khoms-fiqh-text,
  .khoms-fiqh-text p,
  .fiqh-text,
  .fiqh-text p,
  .fiqh-reason-body,
  .fiqh-reason-body p,
  .reason-body,
  .reason-body p,
  .khoms-fiqh-box p,
  .fiqh-box p {
      font-size: 1.10rem !important;
      line-height: 2.15 !important;
      font-weight: 600 !important;
  }

  /* متن مبنا / مسئله */
  .khoms-source,
  .khoms-source p,
  .fiqh-source,
  .fiqh-source p,
  .reason-source,
  .reason-source p {
      font-size: 0.98rem !important;
      line-height: 1.95 !important;
  }

  /* عدد به حروف را دست نمی‌زنیم */
  .money-words,
  .amount-words,
  #moneyWords,
  #khomsWords {
      font-size: inherit !important;
      line-height: inherit !important;
      font-weight: inherit !important;
  }
}

/* کمی بهبود برای دسکتاپ هم */
.khomes-fiqh-title,
.khoms-fiqh-title,
.fiqh-title,
.fiqh-reason-title {
    letter-spacing: 0 !important;
}

.khoms-fiqh-text,
.fiqh-text,
.fiqh-reason-body,
.reason-body {
    text-wrap: pretty;
}

/* CALCINO-KHOMS-MOBILE-FONT-BOOST-END */

