.ehlcp-app,
.ehlcp-app * {
    box-sizing: border-box;
}

.ehlcp-app {
    --ehlcp-bg: #f8fafc;
    --ehlcp-card: #ffffff;
    --ehlcp-text: #0f172a;
    --ehlcp-muted: #64748b;
    --ehlcp-line: #e2e8f0;
    --ehlcp-primary: #1e3a8a;
    --ehlcp-primary-soft: #dbeafe;
    --ehlcp-success: #047857;
    --ehlcp-shadow: 0 16px 45px rgba(15, 23, 42, .08);
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 18px;
    color: var(--ehlcp-text);
    font-family: inherit;
    line-height: 1.9;
}

.ehlcp-tool-head h3 {
    margin: 0;
    font-size: 26px;
    font-weight: 850;
    color: var(--ehlcp-text);
}

.ehlcp-tool-head p {
    margin: 6px 0 0;
    color: var(--ehlcp-muted);
    font-size: 14px;
}

.ehlcp-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ehlcp-card {
    position: relative;
    width: 100%;
    min-height: 150px;
    text-align: right;
    border: 1px solid var(--ehlcp-line);
    border-radius: 22px;
    background: var(--ehlcp-card);
    color: inherit;
    padding: 18px;
    cursor: pointer;
    font: inherit;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.ehlcp-card:hover,
.ehlcp-card:focus-visible {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .10);
    outline: none;
}

.ehlcp-card-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    background: var(--ehlcp-primary-soft);
    color: var(--ehlcp-primary);
    border-radius: 14px;
    font-weight: 850;
    margin-bottom: 12px;
}

.ehlcp-card-title {
    display: block;
    font-weight: 850;
    font-size: 15px;
    margin-bottom: 4px;
}

.ehlcp-card-desc {
    display: block;
    color: var(--ehlcp-muted);
    font-size: 12.5px;
    line-height: 1.75;
    padding-left: 20px;
}

.ehlcp-status {
    position: absolute;
    left: 14px;
    bottom: 14px;
    font-size: 11px;
    border-radius: 999px;
    padding: 3px 9px;
    background: #f1f5f9;
    color: #475569;
}

.ehlcp-status.is-active {
    background: #dcfce7;
    color: var(--ehlcp-success);
}

.ehlcp-tool-panel {
    border: 1px solid var(--ehlcp-line);
    border-radius: 24px;
    background: var(--ehlcp-card);
    box-shadow: var(--ehlcp-shadow);
    padding: 20px;
}

.ehlcp-tool-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--ehlcp-line);
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.ehlcp-back,
.ehlcp-ghost,
.ehlcp-primary {
    border: 0;
    border-radius: 14px;
    padding: 10px 16px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.ehlcp-back,
.ehlcp-ghost {
    background: #f1f5f9;
    color: #334155;
}

.ehlcp-primary {
    background: var(--ehlcp-primary);
    color: #fff;
    box-shadow: 0 12px 22px rgba(30, 58, 138, .22);
}

.ehlcp-primary:hover,
.ehlcp-back:hover,
.ehlcp-ghost:hover {
    filter: brightness(.98);
}

.ehlcp-form {
    display: grid;
    gap: 14px;
}

.ehlcp-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ehlcp-form.is-preview .ehlcp-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ehlcp-field label {
    display: block;
    font-size: 13px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 6px;
}

.ehlcp-field input,
.ehlcp-field select,
.ehlcp-field textarea {
    width: 100%;
    border: 1px solid var(--ehlcp-line);
    background: #fff;
    color: var(--ehlcp-text);
    border-radius: 15px;
    min-height: 46px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.ehlcp-field input:focus,
.ehlcp-field select:focus,
.ehlcp-field textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
}

.ehlcp-field input:disabled {
    background: #f8fafc;
    color: #94a3b8;
}

.ehlcp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 2px;
}

.ehlcp-note {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    color: var(--ehlcp-muted);
    border-radius: 16px;
    padding: 10px 12px;
    font-size: 12.5px;
}

.ehlcp-result {
    margin-top: 18px;
    border-radius: 20px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    padding: 16px;
}

.ehlcp-result-title {
    font-weight: 850;
    margin-bottom: 12px;
    color: var(--ehlcp-primary);
}

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

.ehlcp-result-grid div {
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(191, 219, 254, .75);
    border-radius: 16px;
    padding: 12px;
}

.ehlcp-result-grid span,
.ehlcp-result-grid strong {
    display: block;
}

.ehlcp-result-grid span {
    color: var(--ehlcp-muted);
    font-size: 12px;
}

.ehlcp-result-grid strong {
    font-size: 16px;
    color: #0f172a;
    margin-top: 4px;
}

.ehlcp-result-grid .is-total {
    grid-column: 1 / -1;
    background: #fff;
    border-color: #60a5fa;
}

.ehlcp-result-grid .is-total strong {
    color: var(--ehlcp-primary);
    font-size: 20px;
}

@media (max-width: 768px) {
    .ehlcp-app { padding: 10px; }
    .ehlcp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ehlcp-row,
    .ehlcp-form.is-preview .ehlcp-row,
    .ehlcp-result-grid { grid-template-columns: 1fr; }
    .ehlcp-tool-head { flex-direction: column-reverse; }
}

@media (max-width: 480px) {
    .ehlcp-grid { grid-template-columns: 1fr; }
    .ehlcp-card { min-height: 132px; }
}

/* v1.0.7: keep Elementor/theme typography intact and improve responsiveness */
.ehlcp-app,
.ehlcp-app button,
.ehlcp-app input,
.ehlcp-app select,
.ehlcp-app textarea {
    font-family: inherit;
    letter-spacing: normal;
    word-spacing: normal;
}

.ehlcp-card-title,
.ehlcp-card-desc,
.ehlcp-field label,
.ehlcp-result-grid span,
.ehlcp-result-grid strong {
    letter-spacing: normal;
    word-break: normal;
    overflow-wrap: anywhere;
}

.ehlcp-grid,
.ehlcp-row,
.ehlcp-result-grid {
    min-width: 0;
}

.ehlcp-card {
    min-width: 0;
}

.ehlcp-card:focus-visible,
.ehlcp-primary:focus-visible,
.ehlcp-ghost:focus-visible,
.ehlcp-back:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}

@media (max-width: 1024px) {
    .ehlcp-app {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .ehlcp-app {
        padding: 10px 0;
    }

    .ehlcp-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ehlcp-card {
        min-height: auto;
        padding: 16px;
        border-radius: 18px;
    }

    .ehlcp-tool-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .ehlcp-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ehlcp-primary,
    .ehlcp-ghost,
    .ehlcp-back {
        width: 100%;
    }
}

/* v1.0.8: typography fix only - inherit site/Elementor font and prevent Persian letter spacing issues */
.ehlcp-app,
.ehlcp-app * {
    font-family: inherit !important;
    letter-spacing: 0 !important;
    word-spacing: normal !important;
    text-transform: none !important;
    font-kerning: normal;
}

.ehlcp-app button,
.ehlcp-app input,
.ehlcp-app select,
.ehlcp-app textarea {
    font-family: inherit !important;
}

.ehlcp-tool-head h3,
.ehlcp-card-title,
.ehlcp-result-title {
    font-weight: 700;
}

/* v1.0.9: delay damage month/year picker */
.ehlcp-date-button {
    width: 100%;
    border: 1px solid var(--ehlcp-line);
    background: #fff;
    color: var(--ehlcp-text);
    border-radius: 15px;
    min-height: 46px;
    padding: 10px 12px;
    text-align: right;
    cursor: pointer;
    font: inherit;
}

.ehlcp-date-button:focus-visible {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, .16);
    outline: none;
}

.ehlcp-message {
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
}

.ehlcp-picker {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 18px;
}

.ehlcp-picker-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .38);
}

.ehlcp-picker-box {
    position: relative;
    width: min(520px, 100%);
    max-height: min(760px, calc(100vh - 40px));
    overflow: auto;
    background: var(--ehlcp-card);
    border: 1px solid var(--ehlcp-line);
    border-radius: 24px;
    box-shadow: var(--ehlcp-shadow);
    padding: 18px;
}

.ehlcp-picker-title {
    font-weight: 850;
    font-size: 16px;
    margin-bottom: 14px;
    color: var(--ehlcp-text);
}

.ehlcp-picker-years,
.ehlcp-picker-months {
    display: grid;
    gap: 8px;
}

.ehlcp-picker-years {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: 190px;
    overflow: auto;
    border-bottom: 1px solid var(--ehlcp-line);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.ehlcp-picker-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ehlcp-picker-years button,
.ehlcp-picker-months button,
.ehlcp-picker-ok,
.ehlcp-picker-cancel {
    border: 1px solid var(--ehlcp-line);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--ehlcp-text);
    padding: 9px 10px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.ehlcp-picker-years button.is-selected,
.ehlcp-picker-months button.is-selected,
.ehlcp-picker-ok {
    background: var(--ehlcp-primary);
    border-color: var(--ehlcp-primary);
    color: #fff;
}

.ehlcp-picker-months button:disabled {
    opacity: .38;
    cursor: not-allowed;
}

.ehlcp-picker-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    margin-top: 14px;
}

@media (max-width: 480px) {
    .ehlcp-picker {
        align-items: end;
        padding: 10px;
    }

    .ehlcp-picker-box {
        border-radius: 22px;
    }

    .ehlcp-picker-years {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ehlcp-picker-months {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* v1.0.11: small help text for delay damage date fields */
.ehlcp-label-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.ehlcp-label-line label {
    margin-bottom: 0;
}

.ehlcp-help {
    width: 24px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--ehlcp-line);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--ehlcp-primary);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.ehlcp-help:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
}

.ehlcp-help-text {
    margin: -2px 0 8px;
    padding: 8px 10px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #334155;
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.8;
}

/* v1.0.12: delay damage field/help validation refinements */
.ehlcp-field {
    position: relative;
}

.ehlcp-help-text {
    position: absolute;
    z-index: 20;
    top: 32px;
    right: 0;
    width: min(340px, 100%);
    margin: 0;
    box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
}

.ehlcp-picker-error {
    margin-top: 12px;
    padding: 9px 11px;
    border-radius: 12px;
    border: 1px solid #fdba74;
    background: #fff7ed;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 640px) {
    .ehlcp-help-text {
        width: min(300px, calc(100vw - 44px));
    }
}

/* v1.0.13: header order and compact two-row result */
.ehlcp-tool-head > div {
    text-align: right;
    min-width: 0;
}

.ehlcp-back {
    flex: 0 0 auto;
}

.ehlcp-result-grid.ehlcp-result-grid-simple {
    grid-template-columns: 1fr;
    gap: 10px;
}

.ehlcp-result-grid.ehlcp-result-grid-simple div,
.ehlcp-result-grid.ehlcp-result-grid-simple .is-total {
    grid-column: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 58px;
    padding: 12px 14px;
}

.ehlcp-result-grid.ehlcp-result-grid-simple strong,
.ehlcp-result-grid.ehlcp-result-grid-simple .is-total strong {
    margin-top: 0;
    font-size: 18px;
    white-space: nowrap;
}

.ehlcp-result-grid.ehlcp-result-grid-simple span {
    line-height: 1.7;
}

@media (max-width: 768px) {
    .ehlcp-tool-head {
        flex-direction: column;
    }

    .ehlcp-back {
        align-self: flex-start;
    }
}

@media (max-width: 520px) {
    .ehlcp-result-grid.ehlcp-result-grid-simple div,
    .ehlcp-result-grid.ehlcp-result-grid-simple .is-total {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* v1.0.14: cleaner delay result */
.ehlcp-result {
    margin-top: 14px;
    padding: 12px;
    border-radius: 18px;
}

.ehlcp-result-grid.ehlcp-result-grid-simple {
    gap: 8px;
}

.ehlcp-result-grid.ehlcp-result-grid-simple div,
.ehlcp-result-grid.ehlcp-result-grid-simple .is-total {
    min-height: 52px;
    padding: 10px 14px;
    border-radius: 14px;
}

.ehlcp-result-grid.ehlcp-result-grid-simple .is-total {
    background: #ffffff;
    border-width: 1.5px;
    box-shadow: 0 8px 22px rgba(37, 99, 235, .07);
}

.ehlcp-result-grid.ehlcp-result-grid-simple span {
    font-size: 12px;
    color: #64748b;
}

.ehlcp-result-grid.ehlcp-result-grid-simple strong,
.ehlcp-result-grid.ehlcp-result-grid-simple .is-total strong {
    font-size: 20px;
    line-height: 1.5;
    letter-spacing: 0;
}

.ehlcp-result-grid.ehlcp-result-grid-simple .is-total strong {
    font-size: 23px;
    font-weight: 900;
}

@media (max-width: 520px) {
    .ehlcp-result {
        padding: 10px;
    }
    .ehlcp-result-grid.ehlcp-result-grid-simple div,
    .ehlcp-result-grid.ehlcp-result-grid-simple .is-total {
        gap: 6px;
    }
    .ehlcp-result-grid.ehlcp-result-grid-simple strong,
    .ehlcp-result-grid.ehlcp-result-grid-simple .is-total strong {
        font-size: 18px;
        white-space: normal;
    }
    .ehlcp-result-grid.ehlcp-result-grid-simple .is-total strong {
        font-size: 20px;
    }
}

/* v1.0.16: dowry cash calculator */
.ehlcp-result-note {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 13px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(191, 219, 254, .75);
    color: #334155;
    font-size: 12.5px;
    line-height: 1.8;
}

/* v1.0.16: global money input unit */
.ehlcp-money-wrap {
    position: relative;
    display: block;
    width: 100%;
}

.ehlcp-money-wrap .ehlcp-money-input {
    padding-left: 62px;
    direction: ltr;
    text-align: right;
}

.ehlcp-money-unit {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ehlcp-muted);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
    user-select: none;
}

/* v1.0.18: Rial-only dowry result cards */
.ehlcp-dowry-result-grid {
    grid-template-columns: 1fr;
}

.ehlcp-dowry-result-grid div {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto;
    align-items: center;
    gap: 12px;
}

.ehlcp-dowry-result-grid .is-total {
    grid-column: auto;
}

.ehlcp-dowry-result-grid strong {
    margin-top: 0;
    text-align: left;
    direction: rtl;
}

@media (max-width: 640px) {
    .ehlcp-dowry-result-grid div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .ehlcp-dowry-result-grid strong {
        text-align: right;
    }
}

/* v1.0.20: unified picker for yearly fields */
.ehlcp-picker-year-only .ehlcp-picker-years {
    max-height: 330px;
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0;
}

.ehlcp-date-button span {
    display: inline-block;
}

/* v1.0.21: copy button for calculated result numbers */
.ehlcp-result-grid.ehlcp-result-grid-simple .ehlcp-copy-wrap,
.ehlcp-dowry-result-grid .ehlcp-copy-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    color: inherit;
}

.ehlcp-result-grid.ehlcp-result-grid-simple .ehlcp-copy-wrap strong,
.ehlcp-dowry-result-grid .ehlcp-copy-wrap strong {
    display: inline-block;
}

.ehlcp-copy-result {
    border: 1px solid rgba(37, 99, 235, .18);
    background: rgba(37, 99, 235, .07);
    color: var(--ehlcp-primary);
    border-radius: 11px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.ehlcp-copy-result:hover,
.ehlcp-copy-result:focus-visible {
    background: rgba(37, 99, 235, .12);
    border-color: rgba(37, 99, 235, .28);
    outline: none;
}

.ehlcp-copy-result:active {
    transform: scale(.97);
}

.ehlcp-copy-result.is-copied {
    background: rgba(16, 185, 129, .12);
    border-color: rgba(16, 185, 129, .30);
    color: #047857;
}

@media (max-width: 520px) {
    .ehlcp-result-grid.ehlcp-result-grid-simple .ehlcp-copy-wrap,
    .ehlcp-dowry-result-grid .ehlcp-copy-wrap {
        width: 100%;
        justify-content: space-between;
    }
}

/* v1.0.25: optional death mode for dowry */
.ehlcp-option-card {
    margin-top: 2px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, .22);
    background: rgba(248, 250, 252, .72);
    border-radius: 16px;
}

.ehlcp-checkline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ehlcp-text);
    font-weight: 800;
    font-size: 13.5px;
    cursor: pointer;
    user-select: none;
}

.ehlcp-checkline input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--ehlcp-primary);
    cursor: pointer;
}

.ehlcp-option-card p {
    margin: 7px 25px 0 0;
    color: var(--ehlcp-muted);
    font-size: 12.5px;
    line-height: 1.8;
}

@media (max-width: 520px) {
    .ehlcp-option-card {
        padding: 11px 12px;
    }

    .ehlcp-option-card p {
        margin-right: 0;
    }
}

/* v1.0.29: court fee calculator refinements */
.ehlcp-inline-hint {
    margin-top: 7px;
    color: var(--ehlcp-muted);
    font-size: 12px;
    line-height: 1.8;
}

.ehlcp-field select {
    cursor: pointer;
}

.ehlcp-field[hidden],
.ehlcp-row[hidden],
.ehlcp-result[hidden] {
    display: none !important;
}
