/*
 * Financial Manager — refreshed interface
 * RTL-first, responsive, and intentionally scoped to the plugin UI.
 */
@media screen {
    #fm-overlay,
    .fm-modal {
        --fm-blue: #6254d8;
        --fm-blue-dark: #4e41c4;
        --fm-ink: #20243a;
        --fm-muted: #747b91;
        --fm-border: #e6e8f0;
        --fm-bg: #f5f6fb;
        --fm-danger: #d64b64;
        --fm-green: #13866f;
        --fm-soft-purple: #f0efff;
        --fm-soft-blue: #eef4ff;
        --fm-soft-green: #eaf7f2;
        --fm-card-shadow: 0 8px 24px rgba(34, 39, 73, .055);
        color: var(--fm-ink);
        font-family: Vazirmatn, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 14px;
        line-height: 1.7;
        -webkit-font-smoothing: antialiased;
    }

    #fm-overlay *,
    .fm-modal *,
    #fm-toast * {
        box-sizing: border-box;
    }

    #fm-overlay {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
        background: rgba(17, 21, 43, .62);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .fm-dashboard {
        width: min(1240px, 100%);
        height: min(900px, calc(100vh - 40px));
        height: min(900px, calc(100dvh - 40px));
        min-height: 0;
        border: 1px solid rgba(255, 255, 255, .58);
        border-radius: 26px;
        background: var(--fm-bg);
        box-shadow: 0 32px 100px rgba(10, 15, 38, .32);
        color: var(--fm-ink);
    }

    .fm-header {
        min-height: 88px;
        padding: 18px 30px;
        border-bottom: 1px solid #ececf4;
        background: linear-gradient(110deg, #fff 0%, #fbfaff 100%);
    }

    .fm-brand { gap: 14px; }
    .fm-brand-mark {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        border: 1px solid rgba(255,255,255,.65);
        border-radius: 16px;
        background: linear-gradient(145deg, #786df0, #5547c9);
        box-shadow: 0 8px 18px rgba(88, 74, 204, .24);
        color: #fff;
        font-size: 23px;
    }
    .fm-header h2 { color: #20243a; font-size: 23px; font-weight: 900; line-height: 1.4; }
    .fm-header p { margin-top: 4px; color: #777d91; font-size: 13px; }
    .fm-icon-button {
        width: 40px;
        height: 40px;
        border: 1px solid #eeedf5;
        background: #f7f6fb;
        color: #73788c;
        transition: color .18s ease, background .18s ease, transform .18s ease;
    }
    .fm-icon-button:hover { color: #c4435d; background: #fff0f2; transform: rotate(5deg); }

    .fm-tabs {
        gap: 8px;
        padding: 11px 28px;
        border-bottom: 1px solid #e9eaf2;
        background: #fff;
    }
    .fm-tab {
        min-width: 116px;
        min-height: 43px;
        padding: 9px 16px;
        border: 0;
        border-radius: 12px;
        color: #747b91;
        font-size: 13px;
        font-weight: 800;
        transition: color .18s ease, background .18s ease, transform .18s ease;
    }
    .fm-tab span:first-child { font-size: 17px; }
    .fm-tab:hover { color: var(--fm-blue); background: #f6f5ff; }
    .fm-tab.active { color: #5043c4; background: var(--fm-soft-purple); }

    .fm-content {
        padding: 26px 30px 34px;
        background: var(--fm-bg);
        scrollbar-color: #cbc8ed transparent;
        scrollbar-width: thin;
    }
    .fm-content::-webkit-scrollbar,
    .fm-modal-box::-webkit-scrollbar { width: 8px; }
    .fm-content::-webkit-scrollbar-thumb,
    .fm-modal-box::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 9px; background: #cbc8ed; background-clip: padding-box; }
    .fm-panel.active { animation: fm-redesign-in .2s ease-out; }
    @keyframes fm-redesign-in { from { opacity: .35; transform: translateY(5px); } to { opacity: 1; transform: none; } }

    .fm-section-heading { margin-bottom: 20px; }
    .fm-section-heading h3 { color: #252942; font-size: 25px; font-weight: 900; line-height: 1.45; }
    .fm-section-heading p { color: #737b90; font-size: 14px; }
    .fm-kicker { color: #6a5ddb; font-size: 11px; font-weight: 900; letter-spacing: .4px; }
    .fm-employee-toolbar {
        position: static;
        margin: 0 0 18px;
        padding: 0;
        background: transparent;
    }
    .fm-employee-add-button { display: inline-flex; width: auto; min-height: 44px; align-items: center; justify-content: center; padding-inline: 20px; }

    .fm-primary,
    .fm-secondary-button {
        min-height: 42px;
        border-radius: 12px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 850;
        transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
    }
    .fm-primary {
        padding: 10px 17px;
        background: linear-gradient(135deg, #7164e5, #5748cc);
        box-shadow: 0 7px 16px rgba(91, 76, 206, .18);
    }
    .fm-primary:hover { background: linear-gradient(135deg, #6558d6, #4e40bd); box-shadow: 0 9px 20px rgba(91,76,206,.24); transform: translateY(-1px); }
    .fm-primary:disabled { box-shadow: none; }
    .fm-secondary-button { border: 1px solid #dcd9fb; color: #5447c4; background: #f4f2ff; }
    .fm-secondary-button:hover { color: #4638b1; background: #ebe8ff; }
    .fm-link-button { padding: 7px 10px; border-radius: 9px; color: #5e51cc; font-size: 12px; }
    .fm-link-button:hover { background: #f2f0ff; }

    .fm-card-list { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
    .fm-employee-card {
        min-height: 100px;
        padding: 16px;
        border: 1px solid #e9eaf2;
        border-radius: 18px;
        background: #fff;
        box-shadow: var(--fm-card-shadow);
        transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
    }
    .fm-employee-card:hover { transform: translateY(-2px); border-color: #d5d1fb; box-shadow: 0 14px 28px rgba(34,39,73,.09); }
    .fm-employee-main { gap: 12px; }
    .fm-avatar {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border: 1px solid #e4e1ff;
        border-radius: 15px;
        color: #584bc9;
        background: linear-gradient(145deg, #f0efff, #e7e5ff);
        font-size: 17px;
    }
    .fm-employee-name { color: #252942; font-size: 16px; }
    .fm-employee-job { color: #6458c9; font-size: 11px; }
    .fm-employee-description { color: #747b91; font-size: 12px; }
    .fm-mini-button { width: 34px; height: 34px; border: 1px solid #ececf4; border-radius: 11px; color: #71778c; background: #fafaff; }
    .fm-mini-button:hover { color: #5749c6; background: #f0efff; }
    .fm-mini-button.fm-delete:hover { color: #c3435c; background: #fff0f2; }

    .fm-empty {
        min-height: 190px;
        padding: 28px;
        border: 1px dashed #d8d8e8;
        border-radius: 20px;
        color: #545b72;
        background: rgba(255,255,255,.72);
    }
    .fm-empty-icon { color: #8a80de; }
    .fm-empty strong { font-size: 15px; }
    .fm-empty small { color: #7a8194; font-size: 12px; }

    .fm-period-controls { gap: 10px; }
    .fm-period-controls label,
    .fm-form label { gap: 6px; color: #42475f; font-size: 12px; font-weight: 800; }
    .fm-period-controls select,
    .fm-form input,
    .fm-form select,
    .fm-form textarea {
        min-height: 43px;
        padding: 10px 12px;
        border: 1px solid #e2e4ed;
        border-radius: 11px;
        color: #262a40;
        background: #fff;
        font-family: inherit;
        font-size: 13px;
        transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
    }
    .fm-period-controls select { min-width: 120px; }
    .fm-form textarea { min-height: 94px; line-height: 1.8; }
    .fm-form input::placeholder,
    .fm-form textarea::placeholder { color: #a0a5b4; }
    .fm-form input:focus,
    .fm-form select:focus,
    .fm-form textarea:focus,
    .fm-period-controls select:focus {
        border-color: #9d95ec;
        outline: 0;
        background: #fff;
        box-shadow: 0 0 0 3px rgba(104, 90, 219, .12);
    }

    .fm-summary-grid,
    .fm-report-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
    .fm-summary-card {
        min-height: 112px;
        padding: 16px;
        border: 1px solid #e9eaf2;
        border-radius: 18px;
        background: #fff;
        box-shadow: var(--fm-card-shadow);
    }
    .fm-summary-card:after { width: 70px; height: 70px; opacity: .17; }
    .fm-summary-card .fm-summary-label { color: #737b90; font-size: 11px; font-weight: 800; line-height: 1.65; }
    .fm-summary-amount { margin-top: 7px; }
    .fm-summary-card strong { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.25; }
    .fm-summary-card small { color: #858b9d; font-size: 11px; }
    .fm-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
    .fm-action-card {
        min-height: 84px;
        padding: 14px;
        border: 1px solid #e8e9f1;
        border-radius: 17px;
        background: #fff;
        box-shadow: 0 5px 16px rgba(34,39,73,.035);
        transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    }
    .fm-action-card:hover { transform: translateY(-2px); border-color: #d8d4fa; box-shadow: 0 12px 24px rgba(34,39,73,.08); }
    .fm-action-icon { width: 40px; height: 40px; flex-basis: 40px; border-radius: 14px; font-size: 19px; }
    .fm-action-card strong { color: #2b2f48; font-size: 13px; font-weight: 850; }
    .fm-action-card small { color: #7d8396; font-size: 11px; line-height: 1.6; }

    .fm-inventory-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .fm-list-box,
    .fm-report-section {
        min-width: 0;
        padding: 17px;
        border: 1px solid #e8e9f1;
        border-radius: 19px;
        background: #fff;
        box-shadow: var(--fm-card-shadow);
    }
    .fm-list-box-header { margin-bottom: 13px; }
    .fm-list-box-header h4 { color: #2b2f48; font-size: 14px; font-weight: 900; }
    .fm-list-box-header small { color: #858b9d; font-size: 11px; }
    .fm-record-list { gap: 9px; }
    .fm-record {
        min-width: 0;
        padding: 12px;
        border: 1px solid #eff0f5;
        border-radius: 14px;
        background: #fcfcfe;
        transition: border-color .16s ease, background .16s ease;
    }
    .fm-record:hover { border-color: #dedbf7; background: #fff; }
    .fm-record-title { color: #2d3149; font-size: 13px; font-weight: 850; white-space: normal; }
    .fm-record-meta { color: #7d8498; font-size: 11px; line-height: 1.75; }
    .fm-record-amount { color: #16846e; font-size: 14px; }
    .fm-record-expense .fm-record-amount { color: #c44c62; }
    .fm-record-payment .fm-record-amount { color: #bd7a22; }
    .fm-record-actions { gap: 5px; }
    .fm-advance-list-box { grid-column: 1 / -1; }

    .fm-report-actions { align-items: end; gap: 14px; }
    .fm-print-buttons { gap: 9px; margin-right: 0; }
    .fm-print-button { min-height: 42px; font-size: 12px; }
    .fm-print-a4-button { background: linear-gradient(135deg, #328f80, #167664); }
    .fm-print-a4-button:hover { background: linear-gradient(135deg, #287f72, #116554); }
    .fm-report-section { margin-top: 14px; }
    .fm-report-section h4 { margin-bottom: 12px; color: #32364f; font-size: 14px; font-weight: 900; }
    .fm-report-table { font-size: 12px; }
    .fm-report-table caption { color: #373b54; font-size: 12px; }
    .fm-report-table th,
    .fm-report-table td { padding: 10px 9px; border-bottom: 1px solid #eff0f5; }
    .fm-report-table th { color: #737a8e; background: #f8f8fc; font-size: 11px; }
    .fm-report-person {
        margin-top: 13px;
        padding: 16px;
        border: 1px solid #e7e8f0;
        border-radius: 17px;
        background: #fff;
        box-shadow: 0 5px 17px rgba(34,39,73,.04);
    }
    .fm-report-person h5 { color: #5548c4; font-size: 17px; }
    .fm-report-person-summary { gap: 8px; }
    .fm-report-person-summary > div,
    .fm-report-total-lines > div { padding: 10px 12px; border: 1px solid #eeeff5; border-radius: 12px; background: #fafafe; }
    .fm-report-person-summary span,
    .fm-report-total-lines > div > span { color: #737b90; font-size: 11px; }
    .fm-report-amount strong { color: #282c44; font-size: 16px; }
    .fm-report-amount small { color: #858b9d; font-size: 11px; }
    .fm-report-person-summary > div > strong { font-size: 15px; }
    .fm-report-empty { padding: 24px 14px; border-color: #e2e2ee; border-radius: 15px; color: #7b8296; background: #fcfcfe; font-size: 13px; }

    .fm-modal {
        align-items: center;
        padding: 20px;
        background: rgba(16, 19, 40, .58);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }
    .fm-modal-box {
        width: min(600px, 100%);
        max-height: min(820px, calc(100vh - 40px));
        max-height: min(820px, calc(100dvh - 40px));
        border: 1px solid rgba(255,255,255,.7);
        border-radius: 22px;
        background: #fbfbfe;
        box-shadow: 0 28px 90px rgba(14,18,41,.25);
    }
    .fm-profile-modal { width: min(960px, 100%); max-height: min(92vh, 960px); max-height: min(92dvh, 960px); }
    .fm-modal-header {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 18px 22px 15px;
        border-bottom: 1px solid #e9eaf2;
        background: rgba(255,255,255,.96);
        backdrop-filter: blur(8px);
    }
    .fm-modal-header h3 { color: #252942; font-size: 18px; font-weight: 900; }
    .fm-modal-header p { color: #7e8497; font-size: 11px; }
    .fm-form { gap: 14px; padding: 20px 22px 24px; }
    .fm-form-grid,
    .fm-profile-grid { gap: 12px; }
    .fm-profile-form { gap: 14px; }
    .fm-profile-section {
        gap: 13px;
        padding: 17px;
        border: 1px solid #e8e9f1;
        border-radius: 17px;
        background: #fff;
        box-shadow: 0 4px 15px rgba(34,39,73,.035);
    }
    .fm-profile-section-title { padding-bottom: 11px; border-color: #efeff5; }
    .fm-profile-section-title > span {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        border-radius: 12px;
        background: linear-gradient(145deg, #786ced, #5749c9);
        box-shadow: 0 5px 12px rgba(91,76,206,.17);
        font-size: 13px;
    }
    .fm-profile-section-title h4 { color: #30344d; font-size: 14px; }
    .fm-profile-section-title small { color: #81879a; font-size: 11px; }
    .fm-profile-file .fm-file-field,
    .fm-file-field {
        border: 1px dashed #d7d6e8;
        border-radius: 13px;
        background: #fafaff;
    }
    .fm-profile-file .fm-file-field input[type=file]::file-selector-button {
        border-color: #dedbfa;
        border-radius: 8px;
        color: #594bc9;
        background: #f1efff;
    }
    .fm-profile-file .fm-file-field input[type=file]::file-selector-button:hover { background: #e8e5ff; }
    .fm-private-image-tile { border-color: #e7e8f0; border-radius: 13px; background: #fff; box-shadow: 0 3px 10px rgba(34,39,73,.045); }
    .fm-education-image-tile img,
    .fm-private-image-tile img { border-radius: 9px; }
    .fm-form-note,
    .fm-form label small { color: #7e8497; font-size: 11px; }
    .fm-calculation-hint { border-radius: 12px; color: #5146a7; background: #f0efff; font-size: 12px; }
    .fm-advance-hint { border-right-color: #2c9a82; color: #267968; background: #edf8f4; }
    .fm-upload-status { border-color: #e5e3fb; border-radius: 13px; background: #f8f7ff; }
    .fm-upload-track { background: #e7e6f3; }
    .fm-upload-track > span { background: linear-gradient(90deg, #6b5dde, #4ba796); }

    #fm-toast {
        right: 22px;
        bottom: 22px;
        max-width: min(400px, calc(100vw - 36px));
        padding: 12px 17px;
        border: 1px solid rgba(255,255,255,.22);
        border-radius: 14px;
        background: #262a45;
        box-shadow: 0 14px 35px rgba(14,18,41,.22);
        color: #fff;
        font-family: Vazirmatn, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 12px;
    }
    #fm-toast.error { background: #a93650; }

    #fm-overlay :focus-visible,
    .fm-modal :focus-visible,
    #fm-toast :focus-visible {
        outline: 3px solid rgba(103, 89, 221, .38);
        outline-offset: 2px;
    }

    .fm-launch-button {
        min-height: 46px;
        padding: 11px 21px;
        border-radius: 12px;
        background: linear-gradient(135deg, #7164e5, #5748cc);
        box-shadow: 0 8px 18px rgba(91,76,206,.2);
        font-family: Vazirmatn, "Segoe UI", Tahoma, Arial, sans-serif;
        font-size: 13px;
    }
    .fm-launch-button:hover { background: linear-gradient(135deg, #6558d6, #4e40bd); }
}

@media screen and (max-width: 760px) {
    #fm-overlay { padding: 10px; }
    .fm-dashboard {
        width: 100%;
        height: calc(100vh - 20px);
        height: calc(100dvh - 20px);
        border-radius: 21px;
    }
    .fm-header { min-height: 72px; padding: 13px 16px; }
    .fm-brand-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 14px; font-size: 20px; }
    .fm-header h2 { font-size: 19px; }
    .fm-header p { font-size: 11px; }
    .fm-tabs { position: relative; gap: 5px; padding: 8px 10px; }
    .fm-tab { min-width: 0; min-height: 40px; flex: 1 1 0; padding: 8px 5px; gap: 5px; font-size: 11px; }
    .fm-tab span:first-child { font-size: 15px; }
    .fm-content { padding: 19px 15px 26px; }
    .fm-section-heading h3 { font-size: 22px; }
    .fm-employee-toolbar { top: auto; }
    .fm-employee-add-button { width: 100%; }
    .fm-summary-grid,
    .fm-report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .fm-summary-card { min-height: 99px; padding: 12px; border-radius: 15px; }
    .fm-summary-card strong { font-size: clamp(17px, 5vw, 23px); }
    .fm-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .fm-action-card { min-height: 76px; gap: 8px; padding: 10px; border-radius: 14px; }
    .fm-action-icon { width: 34px; height: 34px; flex-basis: 34px; border-radius: 12px; font-size: 16px; }
    .fm-action-card strong { font-size: 11px; }
    .fm-action-card small { font-size: 10px; }
    .fm-inventory-columns { grid-template-columns: 1fr; }
    .fm-list-box,
    .fm-report-section { padding: 13px; border-radius: 16px; }
    .fm-report-actions { align-items: stretch; flex-direction: column; gap: 12px; width: 100%; }
    .fm-report-toolbar .fm-section-heading { align-items: stretch; }
    .fm-print-buttons { display: grid; width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .fm-print-button { width: 100%; min-height: 42px; padding: 9px 8px; white-space: normal; font-size: 11px; }
    .fm-report-table-wrap { overflow: visible; }
    .fm-report-table,
    .fm-report-table tbody,
    .fm-report-table tr,
    .fm-report-table td { display: block; width: 100%; }
    .fm-report-table thead { display: none; }
    .fm-report-table tr { margin-bottom: 9px; overflow: hidden; border: 1px solid #e9eaf1; border-radius: 13px; background: #fff; }
    .fm-report-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        min-height: 39px;
        padding: 8px 10px;
        border-bottom: 1px solid #f0f0f5;
        direction: rtl;
        text-align: left;
        white-space: normal;
    }
    .fm-report-table td:last-child { border-bottom: 0; }
    .fm-report-table td[data-label]::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: #777e91;
        font-size: 10px;
        font-weight: 800;
        text-align: right;
    }
    .fm-report-table td.ltr { direction: rtl; text-align: left; font-variant-numeric: tabular-nums; }
    .fm-report-table td[colspan] { display: block; text-align: center; }
    .fm-report-person { padding: 13px; border-radius: 15px; }
    .fm-report-person h5 { font-size: 15px; }
    .fm-report-person-summary > div,
    .fm-report-total-lines > div { gap: 8px; padding: 9px 10px; }
    .fm-report-person-summary span,
    .fm-report-total-lines > div > span { font-size: 10px; }
    .fm-report-amount strong { font-size: 14px; }
    .fm-modal { align-items: flex-end; padding: 10px; }
    .fm-modal-box { max-height: calc(94vh - 20px); max-height: calc(94dvh - 20px); border-radius: 20px; }
    .fm-profile-modal { max-height: calc(96vh - 12px); max-height: calc(96dvh - 12px); }
    .fm-modal-header { padding: 15px 16px 12px; }
    .fm-form { padding: 15px 16px 19px; }
    .fm-profile-section { padding: 13px; border-radius: 15px; }
}

@media screen and (max-width: 480px) {
    #fm-overlay { padding: 0; }
    .fm-dashboard { height: 100vh; height: 100dvh; border: 0; border-radius: 0; }
    .fm-header { min-height: 66px; padding: 10px 13px; }
    .fm-brand { gap: 10px; }
    .fm-brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 12px; font-size: 18px; }
    .fm-header h2 { font-size: 17px; }
    .fm-header p { margin-top: 2px; font-size: 10px; }
    .fm-icon-button { width: 36px; height: 36px; }
    .fm-tabs { padding: 7px 8px; }
    .fm-tab { min-height: 38px; font-size: 10px; }
    .fm-content { padding: 15px 11px 22px; }
    .fm-section-heading { gap: 11px; }
    .fm-period-controls { width: 100%; gap: 7px; }
    .fm-period-controls label { min-width: 0; flex: 1 1 0; }
    .fm-period-controls select { min-width: 0; padding-inline: 8px; }
    .fm-summary-grid,
    .fm-report-summary { gap: 7px; }
    .fm-summary-card { min-height: 91px; padding: 10px; }
    .fm-summary-card .fm-summary-label { font-size: 10px; }
    .fm-summary-card strong { font-size: clamp(15px, 4.8vw, 20px); }
    .fm-action-grid { gap: 7px; }
    .fm-action-card { min-height: 72px; padding: 8px; }
    .fm-action-card small { line-height: 1.45; }
    .fm-card-list { grid-template-columns: 1fr; }
    .fm-employee-card { padding: 13px; }
    .fm-form-grid,
    .fm-profile-grid { grid-template-columns: 1fr; }
    .fm-profile-files-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fm-profile-form { gap: 10px; }
    .fm-profile-section { gap: 10px; padding: 11px; }
    .fm-date-selects { gap: 5px; }
    .fm-date-selects select { min-width: 0; padding: 9px 6px; font-size: 12px; }
    .fm-print-buttons { grid-template-columns: 1fr; }
    .fm-modal { padding: 0; }
    .fm-modal-box,
    .fm-profile-modal {
        width: 100%;
        max-height: 96vh;
        max-height: 96dvh;
        border-radius: 19px 19px 0 0;
    }
    .fm-small-modal { width: 100%; }
    .fm-toast { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
}

@media screen and (prefers-reduced-motion: reduce) {
    #fm-overlay *,
    .fm-modal *,
    #fm-toast * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
