/* TAIF V5 — Currency Management Mobile Modal Screens Pro V1
   Base: V2.6.
   Scope: إدارة العملات - نوافذ الموبايل فقط.
   Cleans add/edit/bulk/delete/select windows without touching desktop. */

@media (max-width: 860px){
  body.taif-mobile-mode .taif-currency-management-modal{
    overflow:hidden !important;
    background:#f3f7ff !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal__head{
    flex:0 0 auto !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal__title{
    font-size:15px !important;
    font-weight:900 !important;
    line-height:1.2 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal__subtitle,
  body.taif-mobile-mode .taif-currency-management-modal__eyebrow{
    display:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal__body{
    min-width:0 !important;
    max-width:100% !important;
    overflow:auto !important;
    overflow-x:hidden !important;
    padding:8px !important;
    -webkit-overflow-scrolling:touch !important;
  }

  /* ===== Single add/edit currency form ===== */
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .taif-currency-management-modal__body{
    padding:0 !important;
    overflow:hidden !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-single-editor-panel{
    height:100% !important;
    min-height:0 !important;
    display:grid !important;
    grid-template-rows:minmax(0,1fr) auto !important;
    overflow:hidden !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-single-editor-scroll{
    min-height:0 !important;
    overflow:auto !important;
    overflow-x:hidden !important;
    padding:10px 10px 86px !important;
    -webkit-overflow-scrolling:touch !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-form-grid--single-editor-shell{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    gap:10px !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-form-grid--two,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-form-grid--method-legacy-compact,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-form-grid--method-legacy-compact.is-legacy-mode{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:8px !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    align-items:end !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-field{
    min-width:0 !important;
    width:100% !important;
    max-width:100% !important;
    display:grid !important;
    gap:5px !important;
    overflow:visible !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-field label,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-field__caption{
    min-height:28px !important;
    display:flex !important;
    align-items:flex-end !important;
    justify-content:center !important;
    text-align:center !important;
    color:#334155 !important;
    font-size:11px !important;
    font-weight:900 !important;
    line-height:1.25 !important;
    white-space:normal !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-input,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor :where(.currency-management-method-trigger,.currency-management-flag-picker__trigger,[data-taif-picker-trigger],button[id*="currency-management-currency"]){
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:40px !important;
    height:40px !important;
    padding:0 10px !important;
    border-radius:12px !important;
    font-size:13px !important;
    font-weight:900 !important;
    text-align:center !important;
    box-sizing:border-box !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-name-autocomplete,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor :where(.currency-management-flag-picker,.currency-management-method-picker){
    position:relative !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    overflow:visible !important;
    z-index:4 !important;
  }


  body.taif-mobile-mode .taif-currency-management-modal--single-editor :where(.currency-management-flag-picker,.currency-management-method-picker,.currency-management-name-autocomplete).is-open,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor :where(.currency-management-flag-picker,.currency-management-method-picker)[data-taif-disclosure-open="true"]{
    z-index:9001 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor [data-currency-management-legacy-link-row][hidden],
  body.taif-mobile-mode .taif-currency-management-modal--single-editor [data-currency-management-legacy-link-row][style*="display:none"],
  body.taif-mobile-mode .taif-currency-management-modal--single-editor [data-currency-management-legacy-link-row][style*="display: none"]{
    display:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-name-autocomplete__popover{
    position:absolute !important;
    inset:auto auto auto 0 !important;
    top:calc(100% + 4px) !important;
    right:auto !important;
    left:0 !important;
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    max-height:220px !important;
    overflow:auto !important;
    z-index:9000 !important;
    border-radius:14px !important;
    box-shadow:0 18px 42px rgba(15,23,42,.18) !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor :where(.currency-management-flag-popover,.currency-management-method-popover){
    z-index:9000 !important;
    border-radius:14px !important;
    box-shadow:0 18px 42px rgba(15,23,42,.18) !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-method-popover{
    min-width:0 !important;
    overflow:auto !important;
    padding:5px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-method-popover__option{
    min-height:40px !important;
    padding:8px 10px !important;
    border-radius:12px !important;
    align-items:center !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-method-popover__label{
    font-size:11.7px !important;
    line-height:1.35 !important;
    white-space:normal !important;
    overflow-wrap:anywhere !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-flag-popover{
    min-width:0 !important;
    overflow:hidden !important;
    padding:5px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-flag-popover__search-shell{
    display:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-flag-popover__body{
    max-height:inherit !important;
    overflow:auto !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-flag-popover__grid{
    grid-template-columns:minmax(0,1fr) !important;
    gap:5px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-flag-popover__card{
    min-height:42px !important;
    display:grid !important;
    grid-template-columns:28px minmax(0,1fr) !important;
    grid-template-areas:"flag name" !important;
    gap:6px !important;
    align-items:center !important;
    padding:5px 6px !important;
    text-align:right !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-flag-popover__card-flag{
    grid-area:flag !important;
    width:26px !important;
    height:26px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-flag-popover__card-code{
    display:none !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-flag-popover__card-currency{
    grid-area:name !important;
    display:block !important;
    color:#0f172a !important;
    font-size:10.6px !important;
    font-weight:900 !important;
    line-height:1.25 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-modal-actions,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-modal-actions--dock{
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:8px !important;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px)) !important;
    margin:0 !important;
    background:linear-gradient(180deg,rgba(243,247,255,.35),#f3f7ff 34%,#f3f7ff 100%) !important;
    border-top:1px solid rgba(148,163,184,.16) !important;
    box-shadow:0 -10px 28px rgba(15,23,42,.07) !important;
    z-index:12 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-modal-actions .currency-management-btn{
    width:100% !important;
    min-width:0 !important;
    min-height:44px !important;
    height:44px !important;
    border-radius:14px !important;
    justify-content:center !important;
    font-size:13px !important;
    font-weight:900 !important;
  }

  /* ===== Currency choose/delete pickers ===== */
  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .taif-currency-management-modal__body{
    padding:10px 10px 18px !important;
    overflow:auto !important;
    overflow-x:hidden !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-panel,
  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-list{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-list{
    display:grid !important;
    gap:8px !important;
    padding:0 !important;
    overflow:visible !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card{
    display:grid !important;
    grid-template-columns:46px 74px minmax(0,1fr) 140px !important;
    align-items:center !important;
    gap:6px !important;
    width:100% !important;
    min-width:0 !important;
    min-height:48px !important;
    padding:6px 8px !important;
    border-radius:14px !important;
    border:1px solid rgba(37,99,235,.12) !important;
    background:#fff !important;
    box-shadow:0 6px 16px rgba(15,23,42,.055) !important;
    overflow:hidden !important;
    text-align:right !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__identity{
    display:contents !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__flag{
    grid-column:1 !important;
    width:38px !important;
    height:38px !important;
    justify-self:center !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__text,
  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__head{
    display:contents !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__code{
    grid-column:2 !important;
    width:100% !important;
    min-height:30px !important;
    padding:0 6px !important;
    border-radius:10px !important;
    font-size:12px !important;
    font-weight:900 !important;
    justify-self:stretch !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__name{
    grid-column:3 !important;
    display:block !important;
    min-width:0 !important;
    width:100% !important;
    font-size:14px !important;
    font-weight:900 !important;
    line-height:1.1 !important;
    color:#0f172a !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    text-align:right !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__action{
    grid-column:4 !important;
    align-self:center !important;
    justify-self:stretch !important;
    min-height:34px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    gap:5px !important;
    padding:0 8px !important;
    border-radius:11px !important;
    font-size:11.4px !important;
    font-weight:900 !important;
    white-space:nowrap !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__action svg{
    width:14px !important;
    height:14px !important;
  }

  /* ===== Delete confirmation ===== */
  body.taif-mobile-mode .taif-currency-management-modal--delete-confirm .taif-currency-management-modal__body{
    padding:12px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--delete-confirm .currency-management-delete-card{
    min-height:58px !important;
    display:grid !important;
    grid-template-columns:44px minmax(0,1fr) !important;
    gap:10px !important;
    align-items:center !important;
    padding:10px !important;
    border-radius:14px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--delete-confirm .currency-management-delete-card__flag{
    width:40px !important;
    height:40px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--delete-confirm .currency-management-delete-card__text{
    min-width:0 !important;
    display:flex !important;
    align-items:baseline !important;
    justify-content:flex-end !important;
    gap:8px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--delete-confirm .currency-management-confirm-warning{
    font-size:12px !important;
    line-height:1.65 !important;
    border-radius:14px !important;
    padding:12px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--delete-confirm .currency-management-modal-actions--compact{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:8px !important;
  }

  /* ===== Bulk editor ===== */
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .taif-currency-management-modal__body{
    padding:0 !important;
    overflow:hidden !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-scrollarea{
    width:100% !important;
    min-width:0 !important;
    max-width:100% !important;
    overflow:auto !important;
    overflow-x:auto !important;
    padding:8px 8px 84px !important;
    -webkit-overflow-scrolling:touch !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-sticky-stack{
    position:sticky !important;
    top:0 !important;
    z-index:8 !important;
    gap:6px !important;
    margin:0 0 8px !important;
    width:max-content !important;
    min-width:720px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar{
    min-width:720px !important;
    width:720px !important;
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) !important;
    gap:6px !important;
    padding:6px !important;
    border-radius:12px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar__search{
    width:100% !important;
    max-width:100% !important;
    flex:auto !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar__summary{
    display:flex !important;
    flex-wrap:nowrap !important;
    gap:5px !important;
    overflow:hidden !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-toolbar__pill{
    min-width:0 !important;
    font-size:10px !important;
    white-space:nowrap !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-grid-head,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__row{
    width:720px !important;
    min-width:720px !important;
    max-width:none !important;
    grid-template-columns:34px 58px 122px 68px repeat(4, 98px) !important;
    gap:5px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-grid-head{
    min-height:30px !important;
    padding:4px 8px !important;
    border-radius:12px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-list{
    display:grid !important;
    gap:6px !important;
    width:max-content !important;
    min-width:720px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card{
    width:720px !important;
    min-width:720px !important;
    padding:6px 8px !important;
    border-radius:12px !important;
    overflow:hidden !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__row{
    align-items:center !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__flag{
    width:28px !important;
    height:28px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__code,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-input{
    height:30px !important;
    min-height:30px !important;
    border-radius:9px !important;
    font-size:11px !important;
    font-weight:900 !important;
    padding-inline:6px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__name{
    font-size:11.5px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-bulk-card__pair-badge{
    max-width:100% !important;
    height:26px !important;
    min-height:26px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-modal-actions,
  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-modal-actions--dock{
    position:absolute !important;
    left:0 !important;
    right:0 !important;
    bottom:0 !important;
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    gap:8px !important;
    padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px)) !important;
    margin:0 !important;
    background:#f3f7ff !important;
    border-top:1px solid rgba(148,163,184,.16) !important;
    box-shadow:0 -10px 28px rgba(15,23,42,.08) !important;
    z-index:14 !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--bulk-editor .currency-management-modal-actions .currency-management-btn{
    width:100% !important;
    min-width:0 !important;
    height:44px !important;
    min-height:44px !important;
    border-radius:14px !important;
    font-size:13px !important;
    font-weight:900 !important;
    justify-content:center !important;
  }
}

@media (max-width: 430px){
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-form-grid--two,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-form-grid--method-legacy-compact,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-form-grid--method-legacy-compact.is-legacy-mode{
    gap:7px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-field label,
  body.taif-mobile-mode .taif-currency-management-modal--single-editor .currency-management-field__caption{
    font-size:10.4px !important;
    min-height:25px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card{
    grid-template-columns:42px 66px minmax(0,1fr) 122px !important;
    min-height:46px !important;
    gap:5px !important;
    padding:5px 7px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__flag{
    width:34px !important;
    height:34px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__code{
    font-size:11px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__name{
    font-size:13px !important;
  }

  body.taif-mobile-mode .taif-currency-management-modal--currency-picker .currency-management-picker-card__action{
    min-height:32px !important;
    font-size:10.6px !important;
    padding-inline:6px !important;
  }
}
